media: atomisp: Fix brace style issues in binary.c
Subsystems (4)
PATCH 1/1 media: atomisp: Fix brace style issues in binary.c
Fix checkpatch.pl errors and warnings regarding braces on incorrect lines and braces not required for single statement blocks
--- .../atomisp/pci/runtime/binary/src/binary.c | 78 ++++++++----------- 1 file changed, 31 insertions(+), 47 deletions(-)
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +31 -47
@@ -350,7 +350,8 @@ ia_css_binary_dvs_stat_grid_info(int ia_css_binary_3a_grid_info (const struct ia_css_binary *binary,struct ia_css_grid_info *info, -struct ia_css_pipe *pipe) { +struct ia_css_pipe *pipe) +{struct ia_css_3a_grid_info *s3a_info;int err =0 ;
@@ -441,7 +442,8 @@ supports_bds_factor(u32 supported_factors,static int binary_init_info (struct ia_css_binary_xinfo *info,unsigned int i, -bool *binary_found) { +bool *binary_found) +{const unsigned char *blob = sh_css_blob_info[i].blob;unsigned int size = sh_css_blob_info[i].header.blob.size;
@@ -465,7 +467,8 @@ binary_init_info(struct ia_css_binary_xinfo *info, unsigned int i,* be selected if no other primary matches. */ int -ia_css_binary_init_infos (void ) { +ia_css_binary_init_infos (void ) +{unsigned int i;unsigned int num_of_isp_binaries = sh_css_num_binaries -NUM_OF_SPS -NUM_OF_BLS ;
@@ -477,8 +480,7 @@ ia_css_binary_init_infos(void) {if (!all_binaries)return -ENOMEM ; -for (i =0 ; i < num_of_isp_binaries; i++) - { +for (i =0 ; i < num_of_isp_binaries; i++) {int ret;struct ia_css_binary_xinfo *binary = &all_binaries[i];bool binary_found;
@@ -498,12 +500,12 @@ ia_css_binary_init_infos(void) { }int -ia_css_binary_uninit (void ) { +ia_css_binary_uninit (void ) +{unsigned int i;struct ia_css_binary_xinfo *b; -for (i =0 ; i <IA_CSS_BINARY_NUM_MODES ; i++) - { +for (i =0 ; i <IA_CSS_BINARY_NUM_MODES ; i++) {for (b = binary_infos[i]; b; b = b->next) {if (b->xmem_addr)hmm_free (b->xmem_addr);
@@ -637,7 +639,8 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo,struct ia_css_binary *binary, struct ia_css_resolution *dvs_env, int stream_config_left_padding, - bool accelerator) { + bool accelerator) +{ const struct ia_css_binary_info *info = &xinfo->sp;unsigned int dvs_env_width =0 , dvs_env_height = 0,
@@ -664,25 +667,21 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo,assert (binary); binary->info = xinfo; -if (!accelerator) - { +if (!accelerator) {/* binary->css_params has been filled by accelerator itself. */ err =ia_css_isp_param_allocate_isp_parameters ( &binary->mem_params, &binary->css_params, &info->mem_initializers); -if (err) { +if (err)return err; - } } -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) - { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) {if (out_info[i] && (out_info[i]->res.width !=0 )) { bin_out_info = out_info[i];break ; } } -if (in_info && bin_out_info) - { +if (in_info && bin_out_info) { need_scaling = (in_info->res.width != bin_out_info->res.width) || (in_info->res.height != bin_out_info->res.height); }
@@ -713,8 +712,7 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, binary->internal_frame_info.res.height = isp_internal_height; binary->internal_frame_info.raw_bit_depth = bits_per_pixel; -if (in_info) - { +if (in_info) { binary->effective_in_frame_res.width = in_info->res.width; binary->effective_in_frame_res.height = in_info->res.height;
@@ -742,15 +740,13 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, binary->in_frame_info.crop_info = in_info->crop_info; } -if (online) - { +if (online) { bits_per_pixel =ia_css_util_input_format_bpp ( stream_format, two_ppc); } binary->in_frame_info.raw_bit_depth = bits_per_pixel; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) - { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) {if (out_info[i]) { binary->out_frame_info[i].res.width = out_info[i]->res.width; binary->out_frame_info[i].res.height = out_info[i]->res.height;
@@ -769,8 +765,7 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, } } -if (vf_info && (vf_info->res.width !=0 )) - { +if (vf_info && (vf_info->res.width !=0 )) { err =ia_css_vf_configure (binary, bin_out_info, (struct ia_css_frame_info *)vf_info, &vf_log_ds);if (err) {
@@ -788,8 +783,7 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, binary->input_format = stream_format;/* viewfinder output info */ -if ((vf_info) && (vf_info->res.width !=0 )) - { +if ((vf_info) && (vf_info->res.width !=0 )) {unsigned int vf_out_vecs, vf_out_width, vf_out_height; binary->vf_frame_info.format = vf_info->format;
@@ -821,23 +815,20 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, binary->vf_frame_info.padded_width = vf_out_width; binary->vf_frame_info.res.height = vf_out_height; } - }else - { + }else { binary->vf_frame_info.res.width =0 ; binary->vf_frame_info.padded_width =0 ; binary->vf_frame_info.res.height =0 ; } -if (info->enable.ca_gdc) - { +if (info->enable.ca_gdc) { binary->morph_tbl_width =_ISP_MORPH_TABLE_WIDTH (isp_internal_width); binary->morph_tbl_aligned_width =_ISP_MORPH_TABLE_ALIGNED_WIDTH (isp_internal_width); binary->morph_tbl_height =_ISP_MORPH_TABLE_HEIGHT (isp_internal_height); - }else - { + }else { binary->morph_tbl_width =0 ; binary->morph_tbl_aligned_width =0 ; binary->morph_tbl_height =0 ;
@@ -847,8 +838,7 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, sc_3a_dis_padded_width = binary->in_frame_info.padded_width; sc_3a_dis_height = binary->in_frame_info.res.height;if (bds_out_info && in_info && - bds_out_info->res.width != in_info->res.width) - { + bds_out_info->res.width != in_info->res.width) {/* TODO: Next, "internal_frame_info" should be derived from * bds_out. So this part will change once it is in place! */ sc_3a_dis_width = bds_out_info->res.width + info->pipeline.left_cropping;
@@ -858,18 +848,15 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, s3a_isp_width =_ISP_S3A_ELEMS_ISP_WIDTH (sc_3a_dis_padded_width, info->pipeline.left_cropping); -if (info->s3a.fixed_s3a_deci_log) - { +if (info->s3a.fixed_s3a_deci_log) { s3a_log_deci = info->s3a.fixed_s3a_deci_log; - }else - { + }else { s3a_log_deci =binary_grid_deci_factor_log2 (s3a_isp_width, sc_3a_dis_height); } binary->deci_factor_log2 = s3a_log_deci; -if (info->enable.s3a) - { +if (info->enable.s3a) { binary->s3atbl_width =_ISP_S3ATBL_WIDTH (sc_3a_dis_width, s3a_log_deci);
@@ -882,21 +869,18 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, binary->s3atbl_isp_height =_ISP_S3ATBL_ISP_HEIGHT (sc_3a_dis_height, s3a_log_deci); - }else - { + }else { binary->s3atbl_width =0 ; binary->s3atbl_height =0 ; binary->s3atbl_isp_width =0 ; binary->s3atbl_isp_height =0 ; } -if (info->enable.sc) - { +if (info->enable.sc) { binary->sctbl_width_per_color =_ISP_SCTBL_WIDTH_PER_COLOR (sc_3a_dis_padded_width, s3a_log_deci); binary->sctbl_aligned_width_per_color =SH_CSS_MAX_SCTBL_ALIGNED_WIDTH_PER_COLOR ; binary->sctbl_height =_ISP_SCTBL_HEIGHT (sc_3a_dis_height, s3a_log_deci); - }else - { + }else { binary->sctbl_width_per_color =0 ; binary->sctbl_aligned_width_per_color =0 ; binary->sctbl_height =0 ;
Signature · 1 line
2.53.0
Quoted 2 lines · Matt Wardle
Fix checkpatch.pl errors and warnings regarding braces on incorrect lines and braces not required for single statement blocks
Missing period.
Note, if you are going to do this file-by-file, it won't scale. So, collect (sub)folder and fix all files in that one for the same issue. Then repeat the same for other (sub)folders. Make it a series of the patches.
...
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c binary_init_info(struct ia_css_binary_xinfo *info, unsigned int i, · line 470
Quoted 3 lines
int
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +1
-1-ia_css_binary_init_infos (void) { +ia_css_binary_init_infos (void)
Side note: This can be one line now.
...
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c ia_css_binary_init_infos(void) { · line 503
Quoted 3 lines
int
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +1
-1-ia_css_binary_uninit (void) { +ia_css_binary_uninit (void)
Ditto.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 2 lines · Matt Wardle
Fix checkpatch.pl errors and warnings regarding braces on incorrect lines and braces not required for single statement blocks
Missing period.
Note, if you are going to do this file-by-file, it won't scale. So, collect (sub)folder and fix all files in that one for the same issue. Then repeat the same for other (sub)folders. Make it a series of the patches.
Thanks, will update and submit as a patch series.