General coding style clean up
Subsystems (4)
v2 cover General coding style clean up
This patchset fixes several checkpatch.pl warnings in atomisp_ioctl.c that have been distributed across 2 patches logically.
Rahul Gottipati (2):
media: atomisp: Fix coding style issue - remove beginning whitespaces
media: atomisp: Fix coding style issue - correct multiline comments
.../staging/media/atomisp/pci/atomisp_ioctl.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 media: atomisp: Fix coding style issue - remove beginning whitespaces
This removes whitespaces at the beginning of a few lines to fix some checkpatch.pl warnings.
---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1
drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -3
@@ -512,7 +512,7 @@ const struct atomisp_format_bridge atomisp_output_fmts[] = { };const struct atomisp_format_bridge *atomisp_get_format_bridge ( -unsigned int pixelformat) +unsigned int pixelformat) {unsigned int i;
@@ -525,7 +525,7 @@ const struct atomisp_format_bridge *atomisp_get_format_bridge( }const struct atomisp_format_bridge *atomisp_get_format_bridge_from_mbus ( -u32 mbus_code) +u32 mbus_code) {unsigned int i;
@@ -607,7 +607,7 @@ static int atomisp_enum_input(struct file *file, void *fh, }static unsigned int atomisp_subdev_streaming_count ( -struct atomisp_sub_device *asd) +struct atomisp_sub_device *asd) {return asd->video_out_preview.capq.streaming + asd->video_out_capture.capq.streaming
Signature · 1 line
2.25.1
Mauro Carvalho Chehab
maintainerRe: [PATCH v2 1/2] media: atomisp: Fix coding style issue - remove beginning whitespaces
Em Wed, 22 Jul 2020 16:58:31 +0530
Rahul Gottipati <[email protected]> escreveu:
Quoted 16 lines
This removes whitespaces at the beginning of a few lines to fix some checkpatch.pl warnings.
Signed-off-by Rahul Gottipati <[email protected]>---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/media/atomisp/pci/atomisp_ioctl.c +0
-0
drivers/staging/media/atomisp/pci/atomisp_ioctl.c const struct atomisp_format_bridge atomisp_output_fmts[] = { · line 515
Quoted 5 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +1
-1@@ -512,7 +512,7 @@ const struct atomisp_format_bridge atomisp_output_fmts[] = { };const struct atomisp_format_bridge *atomisp_get_format_bridge ( -unsigned int pixelformat) +unsigned int pixelformat)
This is still a coding style violation, as:
1) the continuation line won't be aligned after the open parenthesis;
2) the line will end with an open parenthesis.
A fix would be:
const struct atomisp_format_bridge * atomisp_get_format_bridge(unsigned int pixelformat)
The same applies to similar patterns.
Yet, patches to atomisp have a high chance of having conflicts, and being rejected, as we're doing lots of non-aesthetic changes on this driver.
Quoted 13 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +1
-1{unsigned int i;@@ -525,7 +525,7 @@ const struct atomisp_format_bridge *atomisp_get_format_bridge( }const struct atomisp_format_bridge *atomisp_get_format_bridge_from_mbus ( -u32 mbus_code) +u32 mbus_code) {unsigned int i;
drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_enum_input(struct file *file, void *fh, · line 613
Quoted 8 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +1
-1@@ -607,7 +607,7 @@ static int atomisp_enum_input(struct file *file, void *fh, }static unsigned int atomisp_subdev_streaming_count ( -struct atomisp_sub_device *asd) +struct atomisp_sub_device *asd) {return asd->video_out_preview.capq.streaming + asd->video_out_capture.capq.streaming
Thanks,
Mauro
PATCH v2 2/2 media: atomisp: Fix coding style issue - correct multiline comments
In reply to Rahul GottipatiThis fixes some coding style issues of multiline comments to correct a few checkpatch.pl warnings.
---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1.
drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +9 -5
@@ -1281,7 +1281,8 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)* But the capture number cannot be determined by HAL. * So HAL only sets the capture number to be 1 and queue multiple * buffers. Atomisp driver needs to check this case and re-trigger -* CSS to do capture when new buffer is queued. */ +* CSS to do capture when new buffer is queued. +*/ if (asd->continuous_mode->val && atomisp_subdev_source_pad(vdev) == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE &&
@@ -1806,7 +1807,7 @@ static int atomisp_streamon(struct file *file, void *fh,/* * set freq to max when streaming count > 1 which indicate * dual camera would run -*/ +*/ if (atomisp_streaming_count (isp) >1 ) {if (atomisp_freq_scaling (isp,ATOMISP_DFS_MODE_MAX , false) <0 )
@@ -2438,7 +2439,8 @@ static int atomisp_g_ext_ctrls(struct file *file, void *fh,int i, ret =0 ;/* input_lock is not need for the Camera related IOCTLs -* The input_lock downgrade the FPS of 3A*/ +* The input_lock downgrade the FPS of 3A +*/ ret =atomisp_camera_g_ext_ctrls (file, fh, c);if (ret != -EINVAL )return ret;
@@ -2521,7 +2523,8 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, void *fh,v4l2_s_ctrl (NULL , isp->flash->ctrl_handler, &ctrl);/* When flash mode is changed we need to reset -* flash state */ +* flash state +*/ if (ctrl.id ==V4L2_CID_FLASH_MODE ) { asd->params.flash_state =ATOMISP_FLASH_IDLE ;
@@ -2560,7 +2563,8 @@ static int atomisp_s_ext_ctrls(struct file *file, void *fh,int i, ret =0 ;/* input_lock is not need for the Camera related IOCTLs -* The input_lock downgrade the FPS of 3A*/ +* The input_lock downgrade the FPS of 3A +*/ ret =atomisp_camera_s_ext_ctrls (file, fh, c);if (ret != -EINVAL )return ret;
Signature · 1 line
2.25.1
Mauro Carvalho Chehab
maintainerRe: [PATCH v2 2/2] media: atomisp: Fix coding style issue - correct multiline comments
Em Wed, 22 Jul 2020 17:00:52 +0530
Rahul Gottipati <[email protected]> escreveu:
Quoted 34 lines
This fixes some coding style issues of multiline comments to correct a few checkpatch.pl warnings.
Signed-off-by Rahul Gottipati <[email protected]>---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1.drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3
-2@@ -1281,7 +1281,8 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)* But the capture number cannot be determined by HAL. * So HAL only sets the capture number to be 1 and queue multiple * buffers. Atomisp driver needs to check this case and re-trigger -* CSS to do capture when new buffer is queued. */ +* CSS to do capture when new buffer is queued. +*/ if (asd->continuous_mode->val && atomisp_subdev_source_pad(vdev) == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE &&@@ -1806,7 +1807,7 @@ static int atomisp_streamon(struct file *file, void *fh,/* * set freq to max when streaming count > 1 which indicate * dual camera would run -*/ +*/ if (atomisp_streaming_count (isp) >1 ) {if (atomisp_freq_scaling (isp,ATOMISP_DFS_MODE_MAX , false) <0 )
drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_g_ext_ctrls(struct file *file, void *fh, · line 2443
Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +2
-1@@ -2438,7 +2439,8 @@ static int atomisp_g_ext_ctrls(struct file *file, void *fh,int i, ret =0 ;/* input_lock is not need for the Camera related IOCTLs -* The input_lock downgrade the FPS of 3A*/ +* The input_lock downgrade the FPS of 3A +*/
On media (and on several subsystems), we keep the first line in blank, on multi-line comments:
/*
* input_lock is not need for the Camera related IOCTLs
* The input_lock downgrade the FPS of 3A
*/
Quoted 14 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +2
-1ret =atomisp_camera_g_ext_ctrls (file, fh, c);if (ret != -EINVAL )return ret;@@ -2521,7 +2523,8 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, void *fh,v4l2_s_ctrl (NULL , isp->flash->ctrl_handler, &ctrl);/* When flash mode is changed we need to reset -* flash state */ +* flash state +*/ if (ctrl.id ==V4L2_CID_FLASH_MODE ) { asd->params.flash_state =ATOMISP_FLASH_IDLE ;
drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_s_ext_ctrls(struct file *file, void *fh, · line 2570
Quoted 9 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +2
-1@@ -2560,7 +2563,8 @@ static int atomisp_s_ext_ctrls(struct file *file, void *fh,int i, ret =0 ;/* input_lock is not need for the Camera related IOCTLs -* The input_lock downgrade the FPS of 3A*/ +* The input_lock downgrade the FPS of 3A +*/ ret =atomisp_camera_s_ext_ctrls (file, fh, c);if (ret != -EINVAL )return ret;
Thanks,
Mauro