From 80b685e677f67fc176e05d69a62ba0e4930c8244 Mon Sep 17 00:00:00 2001 From: Jonathan Bergh Date: Mon, 26 Feb 2024 19:40:23 +0000 Subject: media: staging: media: atomisp: Remove old commented code and fix multiple block comment style This patch fixes the following minor code and code style issues: * Removes a block of commented out (unused) code from the src * Reformats various multiline block comments to meet the kernel code style guidelines for block comments Link: https://lore.kernel.org/r/20240226194023.69070-7-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/pci/sh_css_sp.c | 88 +++++++++++++++------------ 1 file changed, 49 insertions(+), 39 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c index 123937a22118..55f9c89c6932 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -108,11 +108,6 @@ copy_isp_stage_to_sp_stage(void) sh_css_isp_stage.binary_info.iterator.row_stripes_overlap_lines; sh_css_sp_stage.top_cropping = (uint16_t) sh_css_isp_stage.binary_info.pipeline.top_cropping; - /* moved to sh_css_sp_init_stage - sh_css_sp_stage.enable.vf_output = - sh_css_isp_stage.binary_info.enable.vf_veceven || - sh_css_isp_stage.binary_info.num_output_pins > 1; - */ sh_css_sp_stage.enable.sdis = sh_css_isp_stage.binary_info.enable.dis; sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a; } @@ -411,14 +406,15 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf, */ assert(queue_id < SH_CSS_MAX_NUM_QUEUES); - /* Klocwork assumes assert can be disabled; - Since we can get there with any type, and it does not - know that frame_in->dynamic_data_index can only be set - for one of the types in the assert) it has to assume we - can get here for any type. however this could lead to an - out of bounds reference when indexing buf_type about 10 - lines below. In order to satisfy KW an additional if - has been added. This one will always yield true. + /* + * Klocwork assumes assert can be disabled; + * Since we can get there with any type, and it does not + * know that frame_in->dynamic_data_index can only be set + * for one of the types in the assert) it has to assume we + * can get here for any type. however this could lead to an + * out of bounds reference when indexing buf_type about 10 + * lines below. In order to satisfy KW an additional if + * has been added. This one will always yield true. */ if (queue_id < SH_CSS_MAX_NUM_QUEUES) dest_buf->buf_src.queue_id = queue_id; @@ -514,7 +510,8 @@ sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out, frame_in->planes.binary.data.offset; break; default: - /* This should not happen, but in case it does, + /* + * This should not happen, but in case it does, * nullify the planes */ memset(&sp_frame_out->planes, 0, sizeof(sp_frame_out->planes)); @@ -951,9 +948,10 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, sh_css_sp_stage.isp_copy_output = (uint8_t)args->copy_output; sh_css_sp_stage.enable.vf_output = (args->out_vf_frame != NULL); - /* Copy the frame infos first, to be overwritten by the frames, - if these are present. - */ + /* + * Copy the frame infos first, to be overwritten by the frames, + * if these are present. + */ sh_css_sp_stage.frames.effective_in_res.width = binary->effective_in_frame_res.width; sh_css_sp_stage.frames.effective_in_res.height = binary->effective_in_frame_res.height; @@ -1030,10 +1028,12 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, initialize_isp_states(binary); - /* we do this only for preview pipe because in fill_binary_info function + /* + * We do this only for preview pipe because in fill_binary_info function * we assign vf_out res to out res, but for ISP internal processing, we need * the original out res. for video pipe, it has two output pins --- out and - * vf_out, so it can keep these two resolutions already. */ + * vf_out, so it can keep these two resolutions already. + */ if (binary->info->sp.pipeline.mode == IA_CSS_BINARY_MODE_PREVIEW && (binary->vf_downscale_log2 > 0)) { /* TODO: Remove this after preview output decimation is fixed @@ -1069,20 +1069,23 @@ sp_init_stage(struct ia_css_pipeline_stage *stage, */ const char *binary_name = ""; const struct ia_css_binary_xinfo *info = NULL; - /* note: the var below is made static as it is quite large; - if it is not static it ends up on the stack which could - cause issues for drivers - */ + /* + * Note: the var below is made static as it is quite large; + * if it is not static it ends up on the stack which could + * cause issues for drivers + */ static struct ia_css_binary tmp_binary; const struct ia_css_blob_info *blob_info = NULL; struct ia_css_isp_param_css_segments isp_mem_if; - /* LA: should be ia_css_data, should not contain host pointer. - However, CSS/DDR pointer is not available yet. - Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init. - TODO: Call this after CSS/DDR allocation and store that pointer. - Best is to allocate it at stage creation time together with host pointer. - Remove vmem from params. - */ + /* + * LA: should be ia_css_data, should not contain host pointer. + * However, CSS/DDR pointer is not available yet. + * Hack is to store it in params->ddr_ptrs and then copy it late in + * the SP just before vmem init. + * TODO: Call this after CSS/DDR allocation and store that pointer. + * Best is to allocate it at stage creation time together with host + * pointer. Remove vmem from params. + */ struct ia_css_isp_param_css_segments *mem_if = &isp_mem_if; int err = 0; @@ -1122,10 +1125,12 @@ sp_init_stage(struct ia_css_pipeline_stage *stage, } else { /* SP stage */ assert(stage->sp_func != IA_CSS_PIPELINE_NO_FUNC); - /* binary and blob_info are now NULL. - These will be passed to sh_css_sp_init_stage - and dereferenced there, so passing a NULL - pointer is no good. return an error */ + /* + * binary and blob_info are now NULL. + * These will be passed to sh_css_sp_init_stage + * and dereferenced there, so passing a NULL + * pointer is no good. return an error + */ return -EINVAL; } @@ -1259,8 +1264,10 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me, SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id; } - /* For continuous use-cases, SP copy is responsible for sampling the - * parameters */ + /* + * For continuous use-cases, SP copy is responsible for sampling the + * parameters + */ if (continuous) sh_css_sp_group.pipe[thread_id].pipe_config = 0; @@ -1542,7 +1549,8 @@ ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe, assert(pipe); assert(IA_CSS_PIPE_ID_NUM == NR_OF_PIPELINES); - /* Linux kernel does not have UINT16_MAX + /* + * Linux kernel does not have UINT16_MAX * Therefore decided to comment out these 2 asserts for Linux * Alternatives that were not chosen: * - add a conditional #define for UINT16_MAX @@ -1641,7 +1649,8 @@ sh_css_sp_start_isp(void) (unsigned int)sp_address_of(sp_sw_state), (uint32_t)(IA_CSS_SP_SW_TERMINATED)); - /* Note 1: The sp_start_isp function contains a wait till + /* + * Note 1: The sp_start_isp function contains a wait till * the input network is configured by the SP. * Note 2: Not all SP binaries supports host2sp_commands. * In case a binary does support it, the host2sp_command @@ -1651,7 +1660,8 @@ sh_css_sp_start_isp(void) * received, the SP starts configuring the input network. */ - /* we need to set sp_running before we call ia_css_mmu_invalidate_cache + /* + * We need to set sp_running before we call ia_css_mmu_invalidate_cache * as ia_css_mmu_invalidate_cache checks on sp_running to * avoid that it accesses dmem while the SP is not powered */ -- cgit v1.2.3