staging: media: atomisp: remove unnecessary braces in single statement blocks
Subsystems (4)
PATCH 1/1 staging: media: atomisp: remove unnecessary braces in single statement blocks
Remove unnecessary braces around single statement blocks throughout the atomisp driver to comply with kernel coding style.
--- .../pci/camera/pipe/src/pipe_stagedesc.c | 9 ++---- .../atomisp/pci/camera/pipe/src/pipe_util.c | 3 +- .../host/input_formatter.c | 3 +- .../hive_isp_css_common/host/input_system.c | 14 ++++----- .../pci/hive_isp_css_common/host/irq.c | 30 ++++++++----------- .../pci/hive_isp_css_common/host/mmu.c | 3 +- .../pci/hive_isp_css_common/host/vmem.c | 3 +- .../isp/kernels/anr/anr_2/ia_css_anr2.host.c | 3 +- .../pci/isp/kernels/bnlm/ia_css_bnlm.host.c | 6 ++-- .../isp/kernels/ctc/ctc2/ia_css_ctc2.host.c | 7 ++--- .../isp/kernels/eed1_8/ia_css_eed1_8.host.c | 13 ++++---- .../isp/kernels/s3a/s3a_1.0/ia_css_s3a.host.c | 3 +- .../kernels/sdis/sdis_1.0/ia_css_sdis.host.c | 6 ++-- .../atomisp/pci/runtime/binary/src/binary.c | 3 +- .../pci/runtime/debug/src/ia_css_debug.c | 6 ++-- .../pci/runtime/isys/src/virtual_isys.c | 3 +- .../pci/runtime/pipeline/src/pipeline.c | 3 +- .../staging/media/atomisp/pci/sh_css_params.c | 12 +++----- 18 files changed, 47 insertions(+), 83 deletions(-)
drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_stagedesc.c +3 -6
@@ -32,9 +32,8 @@ void ia_css_pipe_get_generic_stage_desc( stage_desc->max_input_width =0 ; stage_desc->mode = binary->info->sp.pipeline.mode; stage_desc->in_frame = in_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] = out_frame[i]; - } stage_desc->vf_frame = vf_frame; ERR:IA_CSS_LEAVE_PRIVATE ("" );
@@ -59,9 +58,8 @@ void ia_css_pipe_get_firmwares_stage_desc( stage_desc->max_input_width =0 ; stage_desc->mode = mode; stage_desc->in_frame = in_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] = out_frame[i]; - } stage_desc->vf_frame = vf_frame; }
@@ -82,8 +80,7 @@ void ia_css_pipe_get_sp_func_stage_desc( stage_desc->mode = (unsigned int )-1 ; stage_desc->in_frame =NULL ; stage_desc->out_frame[0 ] = out_frame; -for (i =1 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =1 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] =NULL ; - } stage_desc->vf_frame =NULL ; }
drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_util.c +1 -2
@@ -26,9 +26,8 @@ void ia_css_pipe_util_create_output_frames(unsigned int i;assert (frames); -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) frames[i] =NULL ; - } } void ia_css_pipe_util_set_output_frames(
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c +1 -2
@@ -62,9 +62,8 @@ void input_formatter_rst(* WICH USES THE STREAM2MEMRY BLOCK. * MUST BE FIXED PROPERLY */ -if (!HIVE_IF_BIN_COPY [ID ]) { +if (!HIVE_IF_BIN_COPY [ID ])input_formatter_reg_store (ID , addr, rst); - }return ; }
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +5 -9
@@ -138,11 +138,10 @@ void receiver_port_enable(hrt_data reg =receiver_port_reg_load (ID , port_ID, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX); -if (cnd) { +if (cnd) reg |=0x01 ; - }else { +else reg &= ~0x01 ; - }receiver_port_reg_store (ID , port_ID, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX, reg);
@@ -194,9 +193,8 @@ static void receiver_rst(assert (ID <N_RX_ID );// Disable all ports. -for (port_id =MIPI_PORT0_ID ; port_id <N_MIPI_PORT_ID ; port_id++) { +for (port_id =MIPI_PORT0_ID ; port_id <N_MIPI_PORT_ID ; port_id++)receiver_port_enable (ID , port_id, false); - }// AM: Additional actions for stopping receiver? }
@@ -830,15 +828,13 @@ input_system_err_t input_system_configuration_commit(void)// The last configuration step is to configure the input buffer. input_system_err_t error =input_buffer_configuration (); -if (error !=INPUT_SYSTEM_ERR_NO_ERROR ) { +if (error !=INPUT_SYSTEM_ERR_NO_ERROR )return error; - }// Translate the whole configuration into registers. error =configuration_to_registers (); -if (error !=INPUT_SYSTEM_ERR_NO_ERROR ) { +if (error !=INPUT_SYSTEM_ERR_NO_ERROR )return error; - }// Translate the whole configuration into ctrl commands etc.
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c +12 -18
@@ -55,9 +55,8 @@ void irq_clear_all(assert (ID <N_IRQ_ID );assert (IRQ_N_CHANNEL [ID ] <=HRT_DATA_WIDTH ); -if (IRQ_N_CHANNEL [ID ] <HRT_DATA_WIDTH ) { +if (IRQ_N_CHANNEL [ID ] <HRT_DATA_WIDTH ) mask = ~((~(hrt_data )0 ) >>IRQ_N_CHANNEL [ID ]); - }irq_reg_store (ID , _HRT_IRQ_CONTROLLER_CLEAR_REG_IDX, mask);
@@ -115,9 +114,9 @@ void irq_enable_pulse( {unsigned int edge_out =0x0 ; -if (pulse) { +if (pulse) edge_out =0xffffffff ; - } +/* output is given as edge, not pulse */ irq_reg_store (ID , _HRT_IRQ_CONTROLLER_EDGE_NOT_PULSE_REG_IDX, edge_out);
@@ -259,9 +258,9 @@ void virq_clear_all(void) {irq_ID_t irq_id; -for (irq_id = (irq_ID_t )0 ; irq_id <N_IRQ_ID ; irq_id++) { +for (irq_id = (irq_ID_t )0 ; irq_id <N_IRQ_ID ; irq_id++)irq_clear_all (irq_id); - } +return ; }
@@ -301,9 +300,9 @@ void virq_clear_info(struct virq_info *irq_info)assert (irq_info); -for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) { +for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) irq_info->irq_status_reg[ID ] =0 ; - } +return ; }
@@ -324,20 +323,17 @@ enum hrt_isp_css_irq_status virq_get_channel_id(break ; } -if (idx ==IRQ_N_CHANNEL [IRQ0_ID ]) { +if (idx ==IRQ_N_CHANNEL [IRQ0_ID ])return hrt_isp_css_irq_status_error; - }/* Check whether there are more bits set on device 0 */ -if (irq_status != (1U << idx)) { +if (irq_status != (1U << idx)) status = hrt_isp_css_irq_status_more_irqs; - }/* Check whether we have an IRQ on one of the nested devices */ for (ID =N_IRQ_ID -1 ;ID > (irq_ID_t )0 ;ID --) { -if (IRQ_NESTING_ID [ID ] == (enum virq_id )idx) { +if (IRQ_NESTING_ID [ID ] == (enum virq_id )idx)break ; - } }/* If we have a nested IRQ, load that state, discard the device 0 state */
@@ -350,9 +346,8 @@ enum hrt_isp_css_irq_status virq_get_channel_id(break ; } -if (idx ==IRQ_N_CHANNEL [ID ]) { +if (idx ==IRQ_N_CHANNEL [ID ])return hrt_isp_css_irq_status_error; - }/* Alternatively check whether there are more bits set on this device */ if (irq_status != (1U << idx)) {
@@ -408,9 +403,8 @@ static inline irq_ID_t virq_get_irq_id(assert (channel_ID);for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) { -if (irq_ID <IRQ_N_ID_OFFSET [ID +1 ]) { +if (irq_ID <IRQ_N_ID_OFFSET [ID +1 ])break ; - } } *channel_ID = (unsigned int )irq_ID -IRQ_N_ID_OFFSET [ID ];
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/mmu.c +1 -2
@@ -32,7 +32,6 @@ void mmu_invalidate_cache_all(void) {mmu_ID_t mmu_id; -for (mmu_id = (mmu_ID_t )0 ; mmu_id <N_MMU_ID ; mmu_id++) { +for (mmu_id = (mmu_ID_t )0 ; mmu_id <N_MMU_ID ; mmu_id++)mmu_invalidate_cache (mmu_id); - } }
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c +1 -2
@@ -168,9 +168,8 @@ static void store_vector(//load_vector (&v[1][0], &to[ISP_NWAY]); /* Fetch the next vector, since it will be overwritten. */ hive_uedge *data = (hive_uedge *)v; -for (i =0 ; i <ISP_NWAY ; i++) { +for (i =0 ; i <ISP_NWAY ; i++)hive_sim_wide_pack (data, (hive_wide)&from[i],ISP_VEC_ELEMBITS , i); - }assert (ISP_BAMEM_BASE [ID ] != (hrt_address) -1 );#if !defined(HRT_MEMORY_ACCESS )ia_css_device_store (ISP_BAMEM_BASE [ID ] + (unsigned long )to, &v, size);
drivers/staging/media/atomisp/pci/isp/kernels/anr/anr_2/ia_css_anr2.host.c +1 -2
@@ -22,9 +22,8 @@ ia_css_anr2_vmem_encode(for (i =0 ; i <ANR_PARAM_SIZE ; i++) {unsigned int j; -for (j =0 ; j <ISP_VEC_NELEMS ; j++) { +for (j =0 ; j <ISP_VEC_NELEMS ; j++) to->data[i][j] = from->data[i *ISP_VEC_NELEMS + j]; - } } }
drivers/staging/media/atomisp/pci/isp/kernels/bnlm/ia_css_bnlm.host.c +2 -4
@@ -125,14 +125,12 @@ ia_css_bnlm_vmem_encode(bnlm_lut_encode (&to->div_lut, div_lut_nearests, div_lut_slopes,BNLM_DIV_LUT_SIZE );memset (to->div_lut_intercepts,0 ,sizeof (to->div_lut_intercepts)); -for (i =0 ; i <BNLM_DIV_LUT_SIZE ; i++) { +for (i =0 ; i <BNLM_DIV_LUT_SIZE ; i++) to->div_lut_intercepts[0 ][i] = div_lut_intercepts[i]; - }memset (to->power_of_2,0 ,sizeof (to->power_of_2)); -for (i =0 ; i < (ISP_VEC_ELEMBITS -1 ); i++) { +for (i =0 ; i < (ISP_VEC_ELEMBITS -1 ); i++) to->power_of_2[0 ][i] =1 << i; - } }/* - Encodes BNLM public parameters into DMEM parameters */
drivers/staging/media/atomisp/pci/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +3 -4
@@ -52,13 +52,12 @@ static int ctc2_slope(int y1, int y0, int x1, int x0)/*the slope must lie within the range (-max_slope-1) >= (dydx) >= (max_slope) */ -if (slope <= -max_slope -1 ) { +if (slope <= -max_slope -1 ) dydx = -max_slope -1 ; - }else if (slope >= max_slope) { +else if (slope >= max_slope) dydx = max_slope; - }else { +else dydx = slope; - }return dydx; }
drivers/staging/media/atomisp/pci/isp/kernels/eed1_8/ia_css_eed1_8.host.c +5 -8
@@ -140,17 +140,14 @@ ia_css_eed1_8_vmem_encode(assert (tcinv_x[0 ] ==0 );assert (fcinv_x[0 ] ==0 ); -for (j =1 ; j <NUMBER_OF_CHGRINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_CHGRINV_POINTS ; j++)assert (chgrinv_x[j] > chgrinv_x[j -1 ]); - } -for (j =1 ; j <NUMBER_OF_TCINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_TCINV_POINTS ; j++)assert (tcinv_x[j] > tcinv_x[j -1 ]); - } -for (j =1 ; j <NUMBER_OF_FCINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_FCINV_POINTS ; j++)assert (fcinv_x[j] > fcinv_x[j -1 ]); - }/* The implementation of the calculating 1/x is based on the availability * of the OP_vec_shuffle16 operation.
@@ -260,9 +257,9 @@ ia_css_eed1_8_encode( to->margin_neg_diff = (from->neg_margin1 - from->neg_margin0);/* Encode DEWEnhance exp (e_dew_enh_asr) */ -for (i =0 ; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS -1 ); i++) { +for (i =0 ; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS -1 ); i++) min_exp =max (min_exp, from->dew_enhance_seg_exp[i]); - } + to->e_dew_enh_asr =13 -clamp (min_exp,0 ,13 ); to->dedgew_max = from->dedgew_max;
drivers/staging/media/atomisp/pci/isp/kernels/s3a/s3a_1.0/ia_css_s3a.host.c +1 -2
@@ -240,9 +240,8 @@ ia_css_s3a_hmem_decode(/* Calculate sum of histogram of R, which should not be less than count_for_3a */ sum_r =0 ; -for (i =0 ; i <HMEM_UNIT_SIZE ; i++) { +for (i =0 ; i <HMEM_UNIT_SIZE ; i++) sum_r += out_ptr[i].r; - }if (sum_r < count_for_3a) {/* histogram is invalid */ return ;
drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +2 -4
@@ -50,9 +50,8 @@ void ia_css_sdis_horicoef_vmem_encode(assert (size % (IA_CSS_DVS_NUM_COEF_TYPES *ISP_VEC_NELEMS *sizeof (short )) ==0 ); -for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++) { +for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++)fill_row (&private[type * stride], &public[type * width], width, padding); - } } void ia_css_sdis_vertcoef_vmem_encode(
@@ -77,9 +76,8 @@ void ia_css_sdis_vertcoef_vmem_encode(assert (size % (IA_CSS_DVS_NUM_COEF_TYPES *ISP_VEC_NELEMS *sizeof (short )) ==0 ); -for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++) { +for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++)fill_row (&private[type * stride], &public[type * height], height, padding); - } } void ia_css_sdis_horiproj_encode(
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +1 -2
@@ -670,9 +670,8 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, 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++) {
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c +2 -4
@@ -1123,9 +1123,8 @@ ia_css_debug_pipe_graph_dump_prologue(void)void ia_css_debug_pipe_graph_dump_epilogue (void ) { -if (strlen (ring_buffer) >0 ) { +if (strlen (ring_buffer) >0 )dtrace_dot (ring_buffer); - }if (pg_inst.stream_format !=N_ATOMISP_INPUT_FORMAT ) {/* An input stream format has been set so assume we have
@@ -1778,9 +1777,8 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)* When tid value is 111b, the data will be interpreted differently: * tid val is ignored, major field contains 2 bits (msb) for format type */ -if (tid_val ==FIELD_TID_SEL_FORMAT_PAT ) { +if (tid_val ==FIELD_TID_SEL_FORMAT_PAT ) dump_format =FIELD_FORMAT_UNPACK (trace_read_buf[j]); - } }switch (dump_format) {case TRACE_DUMP_FORMAT_POINT :
drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +1 -2
@@ -295,9 +295,8 @@ static bool create_input_system_channel(if (!rc)return false; -if (!acquire_sid (me->stream2mmio_id, &me->stream2mmio_sid_id)) { +if (!acquire_sid (me->stream2mmio_id, &me->stream2mmio_sid_id))return false; - } if (!acquire_ib_buffer( metadata ? cfg->metadata.bits_per_pixel :
drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +1 -2
@@ -575,9 +575,8 @@ static int pipeline_stage_create( binary = stage_desc->binary; firmware = stage_desc->firmware; vf_frame = stage_desc->vf_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) out_frame[i] = stage_desc->out_frame[i]; - } stage =kvzalloc_obj (*stage);if (!stage) {
drivers/staging/media/atomisp/pci/sh_css_params.c +4 -8
@@ -1928,9 +1928,8 @@ sh_css_set_per_frame_isp_config_on_pipe( params = stream->per_frame_isp_params_configs;/* update new ISP params object with the new config */ -if (!sh_css_init_isp_params_from_global (stream, params, false, pipe)) { +if (!sh_css_init_isp_params_from_global (stream, params, false, pipe)) err1 = -EINVAL ; - } err2 =sh_css_init_isp_params_from_config (stream->pipes[0 ], params, config, pipe);
@@ -2004,9 +2003,8 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,* user. */ /* we do not exit from this point immediately to allow internal * firmware feature testing. */ -if (is_dp_10bpp) { +if (is_dp_10bpp) err = -EINVAL ; - } }else { err = -EINVAL ; goto exit;
@@ -3034,9 +3032,8 @@ process_kernel_parameters(unsigned int pipe_id,ia_css_ob_configure (¶ms->stream_configs.ob, isp_pipe_version, raw_bit_depth); } -if (params->config_changed[IA_CSS_S3A_ID ]) { +if (params->config_changed[IA_CSS_S3A_ID ])ia_css_s3a_configure (raw_bit_depth); - }/* Copy stage uds parameters to config, since they can differ per stage. */ params->crop_config.crop_pos = params->uds[stage->stage_num].crop_pos;
@@ -3899,9 +3896,8 @@ sh_css_invalidate_params(struct ia_css_stream *stream) params->isp_params_changed = true;for (i =0 ; i <IA_CSS_PIPE_ID_NUM ; i++) {for (j =0 ; j <SH_CSS_MAX_STAGES ; j++) { -for (mem =0 ; mem <N_IA_CSS_MEMORIES ; mem++) { +for (mem =0 ; mem <N_IA_CSS_MEMORIES ; mem++) params->isp_mem_params_changed[i][j][mem] = true; - } } }
Signature · 1 line
2.43.0
Quoted 5 lines · Oskar Ray-Frayssinet
Remove unnecessary braces around single statement blocks throughout the atomisp driver to comply with kernel coding style.
Signed-off-by Oskar Ray-Frayssinet <[email protected]>---
$ ./scripts/checkpatch.pl --strict -g HEAD ERROR: trailing whitespace #201: FILE: drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c:326: +^Iif (idx == IRQ_N_CHANNEL[IRQ0_ID]) $
Alway use "./scripts/checkpatch.pl --strict" before sending a patch off to catch things like this.
Thanks,
ET
PATCH v2 1/1 staging: media: atomisp: remove unnecessary braces in single statement blocks
In reply to Oskar Ray-FrayssinetRemove unnecessary braces around single statement blocks throughout the atomisp driver to comply with kernel coding style.
---
v2: Fix trailing whitespace on irq.c:326
.../pci/camera/pipe/src/pipe_stagedesc.c | 9 ++---- .../atomisp/pci/camera/pipe/src/pipe_util.c | 3 +- .../host/input_formatter.c | 3 +- .../hive_isp_css_common/host/input_system.c | 14 ++++----- .../pci/hive_isp_css_common/host/irq.c | 30 ++++++++----------- .../pci/hive_isp_css_common/host/mmu.c | 3 +- .../pci/hive_isp_css_common/host/vmem.c | 3 +- .../isp/kernels/anr/anr_2/ia_css_anr2.host.c | 3 +- .../pci/isp/kernels/bnlm/ia_css_bnlm.host.c | 6 ++-- .../isp/kernels/ctc/ctc2/ia_css_ctc2.host.c | 7 ++--- .../isp/kernels/eed1_8/ia_css_eed1_8.host.c | 13 ++++---- .../isp/kernels/s3a/s3a_1.0/ia_css_s3a.host.c | 3 +- .../kernels/sdis/sdis_1.0/ia_css_sdis.host.c | 6 ++-- .../atomisp/pci/runtime/binary/src/binary.c | 3 +- .../pci/runtime/debug/src/ia_css_debug.c | 6 ++-- .../pci/runtime/isys/src/virtual_isys.c | 3 +- .../pci/runtime/pipeline/src/pipeline.c | 3 +- .../staging/media/atomisp/pci/sh_css_params.c | 12 +++----- 18 files changed, 47 insertions(+), 83 deletions(-)
drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_stagedesc.c +3 -6
@@ -32,9 +32,8 @@ void ia_css_pipe_get_generic_stage_desc( stage_desc->max_input_width =0 ; stage_desc->mode = binary->info->sp.pipeline.mode; stage_desc->in_frame = in_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] = out_frame[i]; - } stage_desc->vf_frame = vf_frame; ERR:IA_CSS_LEAVE_PRIVATE ("" );
@@ -59,9 +58,8 @@ void ia_css_pipe_get_firmwares_stage_desc( stage_desc->max_input_width =0 ; stage_desc->mode = mode; stage_desc->in_frame = in_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] = out_frame[i]; - } stage_desc->vf_frame = vf_frame; }
@@ -82,8 +80,7 @@ void ia_css_pipe_get_sp_func_stage_desc( stage_desc->mode = (unsigned int )-1 ; stage_desc->in_frame =NULL ; stage_desc->out_frame[0 ] = out_frame; -for (i =1 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =1 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) stage_desc->out_frame[i] =NULL ; - } stage_desc->vf_frame =NULL ; }
drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_util.c +1 -2
@@ -26,9 +26,8 @@ void ia_css_pipe_util_create_output_frames(unsigned int i;assert (frames); -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) frames[i] =NULL ; - } } void ia_css_pipe_util_set_output_frames(
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c +1 -2
@@ -62,9 +62,8 @@ void input_formatter_rst(* WICH USES THE STREAM2MEMRY BLOCK. * MUST BE FIXED PROPERLY */ -if (!HIVE_IF_BIN_COPY [ID ]) { +if (!HIVE_IF_BIN_COPY [ID ])input_formatter_reg_store (ID , addr, rst); - }return ; }
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +5 -9
@@ -138,11 +138,10 @@ void receiver_port_enable(hrt_data reg =receiver_port_reg_load (ID , port_ID, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX); -if (cnd) { +if (cnd) reg |=0x01 ; - }else { +else reg &= ~0x01 ; - }receiver_port_reg_store (ID , port_ID, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX, reg);
@@ -194,9 +193,8 @@ static void receiver_rst(assert (ID <N_RX_ID );// Disable all ports. -for (port_id =MIPI_PORT0_ID ; port_id <N_MIPI_PORT_ID ; port_id++) { +for (port_id =MIPI_PORT0_ID ; port_id <N_MIPI_PORT_ID ; port_id++)receiver_port_enable (ID , port_id, false); - }// AM: Additional actions for stopping receiver? }
@@ -830,15 +828,13 @@ input_system_err_t input_system_configuration_commit(void)// The last configuration step is to configure the input buffer. input_system_err_t error =input_buffer_configuration (); -if (error !=INPUT_SYSTEM_ERR_NO_ERROR ) { +if (error !=INPUT_SYSTEM_ERR_NO_ERROR )return error; - }// Translate the whole configuration into registers. error =configuration_to_registers (); -if (error !=INPUT_SYSTEM_ERR_NO_ERROR ) { +if (error !=INPUT_SYSTEM_ERR_NO_ERROR )return error; - }// Translate the whole configuration into ctrl commands etc.
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c +12 -18
@@ -55,9 +55,8 @@ void irq_clear_all(assert (ID <N_IRQ_ID );assert (IRQ_N_CHANNEL [ID ] <=HRT_DATA_WIDTH ); -if (IRQ_N_CHANNEL [ID ] <HRT_DATA_WIDTH ) { +if (IRQ_N_CHANNEL [ID ] <HRT_DATA_WIDTH ) mask = ~((~(hrt_data )0 ) >>IRQ_N_CHANNEL [ID ]); - }irq_reg_store (ID , _HRT_IRQ_CONTROLLER_CLEAR_REG_IDX, mask);
@@ -115,9 +114,9 @@ void irq_enable_pulse( {unsigned int edge_out =0x0 ; -if (pulse) { +if (pulse) edge_out =0xffffffff ; - } +/* output is given as edge, not pulse */ irq_reg_store (ID , _HRT_IRQ_CONTROLLER_EDGE_NOT_PULSE_REG_IDX, edge_out);
@@ -259,9 +258,9 @@ void virq_clear_all(void) {irq_ID_t irq_id; -for (irq_id = (irq_ID_t )0 ; irq_id <N_IRQ_ID ; irq_id++) { +for (irq_id = (irq_ID_t )0 ; irq_id <N_IRQ_ID ; irq_id++)irq_clear_all (irq_id); - } +return ; }
@@ -301,9 +300,9 @@ void virq_clear_info(struct virq_info *irq_info)assert (irq_info); -for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) { +for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) irq_info->irq_status_reg[ID ] =0 ; - } +return ; }
@@ -324,20 +323,17 @@ enum hrt_isp_css_irq_status virq_get_channel_id(break ; } -if (idx ==IRQ_N_CHANNEL [IRQ0_ID ]) { +if (idx ==IRQ_N_CHANNEL [IRQ0_ID ])return hrt_isp_css_irq_status_error; - }/* Check whether there are more bits set on device 0 */ -if (irq_status != (1U << idx)) { +if (irq_status != (1U << idx)) status = hrt_isp_css_irq_status_more_irqs; - }/* Check whether we have an IRQ on one of the nested devices */ for (ID =N_IRQ_ID -1 ;ID > (irq_ID_t )0 ;ID --) { -if (IRQ_NESTING_ID [ID ] == (enum virq_id )idx) { +if (IRQ_NESTING_ID [ID ] == (enum virq_id )idx)break ; - } }/* If we have a nested IRQ, load that state, discard the device 0 state */
@@ -350,9 +346,8 @@ enum hrt_isp_css_irq_status virq_get_channel_id(break ; } -if (idx ==IRQ_N_CHANNEL [ID ]) { +if (idx ==IRQ_N_CHANNEL [ID ])return hrt_isp_css_irq_status_error; - }/* Alternatively check whether there are more bits set on this device */ if (irq_status != (1U << idx)) {
@@ -408,9 +403,8 @@ static inline irq_ID_t virq_get_irq_id(assert (channel_ID);for (ID = (irq_ID_t )0 ;ID <N_IRQ_ID ;ID ++) { -if (irq_ID <IRQ_N_ID_OFFSET [ID +1 ]) { +if (irq_ID <IRQ_N_ID_OFFSET [ID +1 ])break ; - } } *channel_ID = (unsigned int )irq_ID -IRQ_N_ID_OFFSET [ID ];
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/mmu.c +1 -2
@@ -32,7 +32,6 @@ void mmu_invalidate_cache_all(void) {mmu_ID_t mmu_id; -for (mmu_id = (mmu_ID_t )0 ; mmu_id <N_MMU_ID ; mmu_id++) { +for (mmu_id = (mmu_ID_t )0 ; mmu_id <N_MMU_ID ; mmu_id++)mmu_invalidate_cache (mmu_id); - } }
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/vmem.c +1 -2
@@ -168,9 +168,8 @@ static void store_vector(//load_vector (&v[1][0], &to[ISP_NWAY]); /* Fetch the next vector, since it will be overwritten. */ hive_uedge *data = (hive_uedge *)v; -for (i =0 ; i <ISP_NWAY ; i++) { +for (i =0 ; i <ISP_NWAY ; i++)hive_sim_wide_pack (data, (hive_wide)&from[i],ISP_VEC_ELEMBITS , i); - }assert (ISP_BAMEM_BASE [ID ] != (hrt_address) -1 );#if !defined(HRT_MEMORY_ACCESS )ia_css_device_store (ISP_BAMEM_BASE [ID ] + (unsigned long )to, &v, size);
drivers/staging/media/atomisp/pci/isp/kernels/anr/anr_2/ia_css_anr2.host.c +1 -2
@@ -22,9 +22,8 @@ ia_css_anr2_vmem_encode(for (i =0 ; i <ANR_PARAM_SIZE ; i++) {unsigned int j; -for (j =0 ; j <ISP_VEC_NELEMS ; j++) { +for (j =0 ; j <ISP_VEC_NELEMS ; j++) to->data[i][j] = from->data[i *ISP_VEC_NELEMS + j]; - } } }
drivers/staging/media/atomisp/pci/isp/kernels/bnlm/ia_css_bnlm.host.c +2 -4
@@ -125,14 +125,12 @@ ia_css_bnlm_vmem_encode(bnlm_lut_encode (&to->div_lut, div_lut_nearests, div_lut_slopes,BNLM_DIV_LUT_SIZE );memset (to->div_lut_intercepts,0 ,sizeof (to->div_lut_intercepts)); -for (i =0 ; i <BNLM_DIV_LUT_SIZE ; i++) { +for (i =0 ; i <BNLM_DIV_LUT_SIZE ; i++) to->div_lut_intercepts[0 ][i] = div_lut_intercepts[i]; - }memset (to->power_of_2,0 ,sizeof (to->power_of_2)); -for (i =0 ; i < (ISP_VEC_ELEMBITS -1 ); i++) { +for (i =0 ; i < (ISP_VEC_ELEMBITS -1 ); i++) to->power_of_2[0 ][i] =1 << i; - } }/* - Encodes BNLM public parameters into DMEM parameters */
drivers/staging/media/atomisp/pci/isp/kernels/ctc/ctc2/ia_css_ctc2.host.c +3 -4
@@ -52,13 +52,12 @@ static int ctc2_slope(int y1, int y0, int x1, int x0)/*the slope must lie within the range (-max_slope-1) >= (dydx) >= (max_slope) */ -if (slope <= -max_slope -1 ) { +if (slope <= -max_slope -1 ) dydx = -max_slope -1 ; - }else if (slope >= max_slope) { +else if (slope >= max_slope) dydx = max_slope; - }else { +else dydx = slope; - }return dydx; }
drivers/staging/media/atomisp/pci/isp/kernels/eed1_8/ia_css_eed1_8.host.c +5 -8
@@ -140,17 +140,14 @@ ia_css_eed1_8_vmem_encode(assert (tcinv_x[0 ] ==0 );assert (fcinv_x[0 ] ==0 ); -for (j =1 ; j <NUMBER_OF_CHGRINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_CHGRINV_POINTS ; j++)assert (chgrinv_x[j] > chgrinv_x[j -1 ]); - } -for (j =1 ; j <NUMBER_OF_TCINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_TCINV_POINTS ; j++)assert (tcinv_x[j] > tcinv_x[j -1 ]); - } -for (j =1 ; j <NUMBER_OF_FCINV_POINTS ; j++) { +for (j =1 ; j <NUMBER_OF_FCINV_POINTS ; j++)assert (fcinv_x[j] > fcinv_x[j -1 ]); - }/* The implementation of the calculating 1/x is based on the availability * of the OP_vec_shuffle16 operation.
@@ -260,9 +257,9 @@ ia_css_eed1_8_encode( to->margin_neg_diff = (from->neg_margin1 - from->neg_margin0);/* Encode DEWEnhance exp (e_dew_enh_asr) */ -for (i =0 ; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS -1 ); i++) { +for (i =0 ; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS -1 ); i++) min_exp =max (min_exp, from->dew_enhance_seg_exp[i]); - } + to->e_dew_enh_asr =13 -clamp (min_exp,0 ,13 ); to->dedgew_max = from->dedgew_max;
drivers/staging/media/atomisp/pci/isp/kernels/s3a/s3a_1.0/ia_css_s3a.host.c +1 -2
@@ -240,9 +240,8 @@ ia_css_s3a_hmem_decode(/* Calculate sum of histogram of R, which should not be less than count_for_3a */ sum_r =0 ; -for (i =0 ; i <HMEM_UNIT_SIZE ; i++) { +for (i =0 ; i <HMEM_UNIT_SIZE ; i++) sum_r += out_ptr[i].r; - }if (sum_r < count_for_3a) {/* histogram is invalid */ return ;
drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +2 -4
@@ -50,9 +50,8 @@ void ia_css_sdis_horicoef_vmem_encode(assert (size % (IA_CSS_DVS_NUM_COEF_TYPES *ISP_VEC_NELEMS *sizeof (short )) ==0 ); -for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++) { +for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++)fill_row (&private[type * stride], &public[type * width], width, padding); - } } void ia_css_sdis_vertcoef_vmem_encode(
@@ -77,9 +76,8 @@ void ia_css_sdis_vertcoef_vmem_encode(assert (size % (IA_CSS_DVS_NUM_COEF_TYPES *ISP_VEC_NELEMS *sizeof (short )) ==0 ); -for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++) { +for (type =0 ; type <IA_CSS_DVS_NUM_COEF_TYPES ; type++)fill_row (&private[type * stride], &public[type * height], height, padding); - } } void ia_css_sdis_horiproj_encode(
drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +1 -2
@@ -670,9 +670,8 @@ ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, 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++) {
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c +2 -4
@@ -1123,9 +1123,8 @@ ia_css_debug_pipe_graph_dump_prologue(void)void ia_css_debug_pipe_graph_dump_epilogue (void ) { -if (strlen (ring_buffer) >0 ) { +if (strlen (ring_buffer) >0 )dtrace_dot (ring_buffer); - }if (pg_inst.stream_format !=N_ATOMISP_INPUT_FORMAT ) {/* An input stream format has been set so assume we have
@@ -1778,9 +1777,8 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)* When tid value is 111b, the data will be interpreted differently: * tid val is ignored, major field contains 2 bits (msb) for format type */ -if (tid_val ==FIELD_TID_SEL_FORMAT_PAT ) { +if (tid_val ==FIELD_TID_SEL_FORMAT_PAT ) dump_format =FIELD_FORMAT_UNPACK (trace_read_buf[j]); - } }switch (dump_format) {case TRACE_DUMP_FORMAT_POINT :
drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c +1 -2
@@ -295,9 +295,8 @@ static bool create_input_system_channel(if (!rc)return false; -if (!acquire_sid (me->stream2mmio_id, &me->stream2mmio_sid_id)) { +if (!acquire_sid (me->stream2mmio_id, &me->stream2mmio_sid_id))return false; - } if (!acquire_ib_buffer( metadata ? cfg->metadata.bits_per_pixel :
drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +1 -2
@@ -575,9 +575,8 @@ static int pipeline_stage_create( binary = stage_desc->binary; firmware = stage_desc->firmware; vf_frame = stage_desc->vf_frame; -for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) { +for (i =0 ; i <IA_CSS_BINARY_MAX_OUTPUT_PORTS ; i++) out_frame[i] = stage_desc->out_frame[i]; - } stage =kvzalloc_obj (*stage);if (!stage) {
drivers/staging/media/atomisp/pci/sh_css_params.c +4 -8
@@ -1928,9 +1928,8 @@ sh_css_set_per_frame_isp_config_on_pipe( params = stream->per_frame_isp_params_configs;/* update new ISP params object with the new config */ -if (!sh_css_init_isp_params_from_global (stream, params, false, pipe)) { +if (!sh_css_init_isp_params_from_global (stream, params, false, pipe)) err1 = -EINVAL ; - } err2 =sh_css_init_isp_params_from_config (stream->pipes[0 ], params, config, pipe);
@@ -2004,9 +2003,8 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,* user. */ /* we do not exit from this point immediately to allow internal * firmware feature testing. */ -if (is_dp_10bpp) { +if (is_dp_10bpp) err = -EINVAL ; - } }else { err = -EINVAL ; goto exit;
@@ -3034,9 +3032,8 @@ process_kernel_parameters(unsigned int pipe_id,ia_css_ob_configure (¶ms->stream_configs.ob, isp_pipe_version, raw_bit_depth); } -if (params->config_changed[IA_CSS_S3A_ID ]) { +if (params->config_changed[IA_CSS_S3A_ID ])ia_css_s3a_configure (raw_bit_depth); - }/* Copy stage uds parameters to config, since they can differ per stage. */ params->crop_config.crop_pos = params->uds[stage->stage_num].crop_pos;
@@ -3899,9 +3896,8 @@ sh_css_invalidate_params(struct ia_css_stream *stream) params->isp_params_changed = true;for (i =0 ; i <IA_CSS_PIPE_ID_NUM ; i++) {for (j =0 ; j <SH_CSS_MAX_STAGES ; j++) { -for (mem =0 ; mem <N_IA_CSS_MEMORIES ; mem++) { +for (mem =0 ; mem <N_IA_CSS_MEMORIES ; mem++) params->isp_mem_params_changed[i][j][mem] = true; - } } }
Signature · 1 line
2.43.0
Quoted 5 lines · Oskar Ray-Frayssinet
Remove unnecessary braces around single statement blocks throughout the atomisp driver to comply with kernel coding style.
Signed-off-by Oskar Ray-Frayssinet <[email protected]>---
LGTM.
Thanks,
ET
Sakari Ailus
reviewerHi Oskar,
Quoted 2 lines · Oskar Ray-Frayssinet
Remove unnecessary braces around single statement blocks throughout the atomisp driver to comply with kernel coding style.
Did you write this manually or generate it with e.g. Coccinelle?
Signature · 3 lines
Regards, Sakari Ailus
Hi Sakari,
Quoted 1 line · Sakari Ailus
Did you write this manually or generate it with e.g. Coccinelle?
I made the changes manually, file by file, using Vim.
Best regards,
Oskar Ray-Frayssinet
Quoted 6 lines · Oskar Ray-Frayssinet
Hi Sakari,
Quoted 1 line · Sakari Ailus
Did you write this manually or generate it with e.g. Coccinelle?
I made the changes manually, file by file, using Vim.
I'm afraid this no longer applies to my atomisp branch.
Signature · 1 line
Sakari Ailus