Re: [PATCH v3] staging: media: av7110: fix coding style
From: Andy Shevchenko
Date: Mon Mar 23 2026 - 05:06:11 EST
On Sat, Mar 21, 2026 at 01:16:01PM +0530, Chethan C wrote:
> Fixed Indentation, Alignment issues reported by checkpatch.pl.
>
> Renamed enum av7110_rec_play_state, av7110_type_rec_play_format,
> av7110_encoder_command from camel case to upper case underscore
> style to comply kernel style guidelines.
Some changes are questionable, some need improvement, see a bit below.
...
> + ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, AV7110_SET_MONITOR_TYPE,
> 1, (u16)av7110->display_ar);
Also check if you need a casting.
> if (ret < 0)
> pr_err("unable to set aspect ratio\n");
...
> - ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 2, wss_cfg_4_3);
> + ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, AV7110_SET_WSS_CONFIG, 2, 2, wss_cfg_4_3);
The media subsystem is strict about 80 character limit. Yes, the original is
also long, but this makes it worse. Same for other similar cases.
> if (ret < 0)
> pr_err("unable to configure 4:3 wss\n");
...
> - ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Record, 2, AudioPES, 0);
> + ret = av7110_fw_cmd(av7110,
> + COMTYPE_REC_PLAY,
> + AV7110_REC_PLAY_RECORD,
> + 2,
> + AV7110_AUDIO_PES, 0);
Here and in some other places out of a sudden the style is changed to "one
parameter per line", why?
...
> enum av7110_type_rec_play_format {
> - RP_None,
> - AudioPES,
> - AudioMp2,
> - AudioPCM,
> - VideoPES,
> - AV_PES
> + AV7110_RP_NONE,
> + AV7110_AUDIO_PES,
> + AV7110_AUDIO_MP2,
> + AV7110_AUDIO_PCM,
> + AV7110_VIDEO_PES,
> + AV7110_AV_PES
While there is no comma in the original, this is not a terminator entry, so
while at it, add trailing comma.
> };
...
> enum av7110_pid_command {
> - MultiPID,
> - VideoPID,
> - AudioPID,
> - InitFilt,
> - FiltError,
> - NewVersion,
> - CacheError,
> - AddPIDFilter,
> - DelPIDFilter,
> - Scan,
> - SetDescr,
> - SetIR,
> - FlushTSQueue
> + AV7110_MULTI_PID,
> + AV7110_VIDEO_PID,
> + AV7110_AUDIO_PID,
> + AV7110_INIT_FILT,
> + AV7110_FILT_ERROR,
> + AV7110_NEW_VERSION,
> + AV7110_CACHE_ERROR,
> + AV7110_ADD_PID_FILTER,
> + AV7110_DEL_PID_FILTER,
> + AV7110_SCAN,
> + AV7110_SET_DESCR,
> + AV7110_SET_IR,
> + AV7110_FLUSH_TS_QUEUE
> };
Ditto.
...
> enum av7110_encoder_command {
> - SetVidMode,
> - SetTestMode,
> - LoadVidCode,
> - SetMonitorType,
> - SetPanScanType,
> - SetFreezeMode,
> - SetWSSConfig
> + AV7110_SET_VID_MODE,
> + AV7110_SET_TEST_MODE,
> + AV7110_LOAD_VID_CODE,
> + AV7110_SET_MONITOR_TYPE,
> + AV7110_SET_PANSCAN_TYPE,
> + AV7110_SET_FREEZE_MODE,
> + AV7110_SET_WSS_CONFIG
> };
Ditto.
> enum av7110_rec_play_state {
> - __Record,
> - __Stop,
> - __Play,
> - __Pause,
> - __Slow,
> - __FF_IP,
> - __Scan_I,
> - __Continue
> + AV7110_REC_PLAY_RECORD,
> + AV7110_REC_PLAY_STOP,
> + AV7110_REC_PLAY_PLAY,
> + AV7110_REC_PLAY_PAUSE,
> + AV7110_REC_PLAY_SLOW,
> + AV7110_REC_PLAY_FF_IP,
> + AV7110_REC_PLAY_SCAN_I,
> + AV7110_REC_PLAY_CONTINUE
> };
Ditto.
--
With Best Regards,
Andy Shevchenko