Browse Source

video: driver: fix few checker warning

Fix braces are not necessary warning and suspect code
indentation warning.

Change-Id: I6e599d94766cc34013a0ddd758cf5c6609798ea2
Signed-off-by: Ankush Mitra <[email protected]>
Ankush Mitra 2 years ago
parent
commit
30b8ff5ce2

+ 3 - 5
driver/platform/common/src/msm_vidc_platform.c

@@ -1126,9 +1126,8 @@ int msm_vidc_adjust_slice_count(void *instance, struct v4l2_ctrl *ctrl)
 		ENH_LAYER_COUNT, &enh_layer_count, __func__))
 		ENH_LAYER_COUNT, &enh_layer_count, __func__))
 		return -EINVAL;
 		return -EINVAL;
 
 
-	if (enh_layer_count && msm_vidc_check_all_layer_bitrate_set(inst)) {
+	if (enh_layer_count && msm_vidc_check_all_layer_bitrate_set(inst))
 		bitrate = msm_vidc_get_cumulative_bitrate(inst);
 		bitrate = msm_vidc_get_cumulative_bitrate(inst);
-	}
 
 
 	fps = inst->capabilities[FRAME_RATE].value >> 16;
 	fps = inst->capabilities[FRAME_RATE].value >> 16;
 	if (fps > MAX_SLICES_FRAME_RATE ||
 	if (fps > MAX_SLICES_FRAME_RATE ||
@@ -2263,11 +2262,10 @@ int msm_vidc_adjust_dec_outbuf_fence_direction(void *instance, struct v4l2_ctrl
 		META_OUTBUF_FENCE, &meta_outbuf_fence, __func__))
 		META_OUTBUF_FENCE, &meta_outbuf_fence, __func__))
 		return -EINVAL;
 		return -EINVAL;
 
 
-	if (is_meta_rx_inp_enabled(inst, META_OUTBUF_FENCE)) {
+	if (is_meta_rx_inp_enabled(inst, META_OUTBUF_FENCE))
 		adjusted_value = MSM_VIDC_FENCE_DIR_TX;
 		adjusted_value = MSM_VIDC_FENCE_DIR_TX;
-	} else {
+	else
 		adjusted_value = MSM_VIDC_FENCE_DIR_NONE;
 		adjusted_value = MSM_VIDC_FENCE_DIR_NONE;
-	}
 
 
 	msm_vidc_update_cap_value(inst, OUTBUF_FENCE_DIRECTION,
 	msm_vidc_update_cap_value(inst, OUTBUF_FENCE_DIRECTION,
 		adjusted_value, __func__);
 		adjusted_value, __func__);

+ 5 - 5
driver/variant/iris2/inc/hfi_buffer_iris2.h

@@ -128,8 +128,8 @@ typedef HFI_U32 HFI_BOOL;
 
 
 #define HFI_YUV420_TP10_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
 #define HFI_YUV420_TP10_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
 	do { \
 	do { \
-	stride = HFI_ALIGN(frame_width, 192); \
-	stride = HFI_ALIGN(stride * 4 / 3, stride_multiple); \
+		stride = HFI_ALIGN(frame_width, 192); \
+		stride = HFI_ALIGN(stride * 4 / 3, stride_multiple); \
 	} while (0)
 	} while (0)
 
 
 #define HFI_YUV420_TP10_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 #define HFI_YUV420_TP10_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
@@ -150,9 +150,9 @@ typedef HFI_U32 HFI_BOOL;
 #define HFI_YUV420_TP10_CALC_BUF_SIZE(buf_size, y_buf_size, y_stride,\
 #define HFI_YUV420_TP10_CALC_BUF_SIZE(buf_size, y_buf_size, y_stride,\
 		y_buf_height, uv_buf_size, uv_stride, uv_buf_height) \
 		y_buf_height, uv_buf_size, uv_stride, uv_buf_height) \
 	do { \
 	do { \
-	y_buf_size = (y_stride * y_buf_height); \
-	uv_buf_size = (uv_stride * uv_buf_height); \
-	buf_size = y_buf_size + uv_buf_size; \
+		y_buf_size = (y_stride * y_buf_height); \
+		uv_buf_size = (uv_stride * uv_buf_height); \
+		buf_size = y_buf_size + uv_buf_size; \
 	} while (0)
 	} while (0)
 
 
 #define HFI_YUV420_TP10_UBWC_CALC_Y_BUF_SIZE(y_buf_size, y_stride, \
 #define HFI_YUV420_TP10_UBWC_CALC_Y_BUF_SIZE(y_buf_size, y_stride, \

+ 1 - 2
driver/variant/iris2/src/msm_vidc_iris2.c

@@ -867,9 +867,8 @@ int msm_vidc_adjust_blur_type_iris2(void *instance, struct v4l2_ctrl *ctrl)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	if (adjusted_value == MSM_VIDC_BLUR_EXTERNAL) {
 	if (adjusted_value == MSM_VIDC_BLUR_EXTERNAL) {
-		if (is_scaling_enabled(inst) || min_quality) {
+		if (is_scaling_enabled(inst) || min_quality)
 			adjusted_value = MSM_VIDC_BLUR_NONE;
 			adjusted_value = MSM_VIDC_BLUR_NONE;
-		}
 	} else if (adjusted_value == MSM_VIDC_BLUR_ADAPTIVE) {
 	} else if (adjusted_value == MSM_VIDC_BLUR_ADAPTIVE) {
 		if (is_scaling_enabled(inst) || min_quality ||
 		if (is_scaling_enabled(inst) || min_quality ||
 			(rc_type != HFI_RC_VBR_CFR) ||
 			(rc_type != HFI_RC_VBR_CFR) ||

+ 3 - 3
driver/variant/iris2/src/msm_vidc_power_iris2.c

@@ -564,9 +564,9 @@ static u64 __calculate_encoder(struct vidc_bus_vote_data *d)
 	}
 	}
 
 
 	if (llc_ref_chroma_cache_enabled) {
 	if (llc_ref_chroma_cache_enabled) {
-	total_ref_read_crcb = ddr.ref_read_crcb;
-	ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
-			ref_cbcr_read_bw_factor);
+		total_ref_read_crcb = ddr.ref_read_crcb;
+		ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
+					   ref_cbcr_read_bw_factor);
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 	}
 	}
 
 

+ 6 - 8
driver/variant/iris3/src/msm_vidc_power_iris3.c

@@ -565,9 +565,8 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
 				vsp_cycles += div_u64(vpp_cycles * 25, 100);
 				vsp_cycles += div_u64(vpp_cycles * 25, 100);
 
 
 			/* Add 25 percent extra for HEVC 10bit all intra use case */
 			/* Add 25 percent extra for HEVC 10bit all intra use case */
-			if (inst->iframe && is_hevc_10bit_decode_session(inst)) {
+			if (inst->iframe && is_hevc_10bit_decode_session(inst))
 				vsp_cycles += div_u64(vsp_cycles * 25, 100);
 				vsp_cycles += div_u64(vsp_cycles * 25, 100);
-			}
 
 
 			if (inst->codec == MSM_VIDC_VP9 &&
 			if (inst->codec == MSM_VIDC_VP9 &&
 					inst->capabilities[STAGE].value ==
 					inst->capabilities[STAGE].value ==
@@ -697,11 +696,10 @@ static u64 __calculate_decoder(struct vidc_bus_vote_data *d)
 
 
 	if (d->codec == MSM_VIDC_AV1) {
 	if (d->codec == MSM_VIDC_AV1) {
 		collocated_bytes_per_lcu = 4 * 512; /* lcu_size = 128 */
 		collocated_bytes_per_lcu = 4 * 512; /* lcu_size = 128 */
-		if (lcu_size == 32) {
+		if (lcu_size == 32)
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 32 / 32);
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 32 / 32);
-		} else if (lcu_size == 64) {
+		else if (lcu_size == 64)
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 64 / 64);
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 64 / 64);
-		}
 	}
 	}
 
 
 	dpb_factor = FP(1, 50, 100);
 	dpb_factor = FP(1, 50, 100);
@@ -1008,9 +1006,9 @@ static u64 __calculate_encoder(struct vidc_bus_vote_data *d)
 	}
 	}
 
 
 	if (llc_ref_chroma_cache_enabled) {
 	if (llc_ref_chroma_cache_enabled) {
-	total_ref_read_crcb = ddr.ref_read_crcb;
-	ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
-			ref_cbcr_read_bw_factor);
+		total_ref_read_crcb = ddr.ref_read_crcb;
+		ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
+					   ref_cbcr_read_bw_factor);
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 	}
 	}
 
 

+ 6 - 8
driver/variant/iris33/src/msm_vidc_power_iris33.c

@@ -714,9 +714,8 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
 				vsp_cycles += div_u64(vpp_cycles * 25, 100);
 				vsp_cycles += div_u64(vpp_cycles * 25, 100);
 
 
 			/* Add 25 percent extra for HEVC 10bit all intra use case */
 			/* Add 25 percent extra for HEVC 10bit all intra use case */
-			if (inst->iframe && is_hevc_10bit_decode_session(inst)) {
+			if (inst->iframe && is_hevc_10bit_decode_session(inst))
 				vsp_cycles += div_u64(vsp_cycles * 25, 100);
 				vsp_cycles += div_u64(vsp_cycles * 25, 100);
-			}
 
 
 			if (inst->codec == MSM_VIDC_VP9 &&
 			if (inst->codec == MSM_VIDC_VP9 &&
 					inst->capabilities[STAGE].value ==
 					inst->capabilities[STAGE].value ==
@@ -850,11 +849,10 @@ static u64 __calculate_decoder(struct vidc_bus_vote_data *d)
 
 
 	if (d->codec == MSM_VIDC_AV1) {
 	if (d->codec == MSM_VIDC_AV1) {
 		collocated_bytes_per_lcu = 4 * 512; /* lcu_size = 128 */
 		collocated_bytes_per_lcu = 4 * 512; /* lcu_size = 128 */
-		if (lcu_size == 32) {
+		if (lcu_size == 32)
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 32 / 32);
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 32 / 32);
-		} else if (lcu_size == 64) {
+		else if (lcu_size == 64)
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 64 / 64);
 			collocated_bytes_per_lcu = 4 * 512 / (128 * 128 / 64 / 64);
-		}
 	}
 	}
 
 
 	dpb_factor = FP(1, 50, 100);
 	dpb_factor = FP(1, 50, 100);
@@ -1161,9 +1159,9 @@ static u64 __calculate_encoder(struct vidc_bus_vote_data *d)
 	}
 	}
 
 
 	if (llc_ref_chroma_cache_enabled) {
 	if (llc_ref_chroma_cache_enabled) {
-	total_ref_read_crcb = ddr.ref_read_crcb;
-	ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
-			ref_cbcr_read_bw_factor);
+		total_ref_read_crcb = ddr.ref_read_crcb;
+		ddr.ref_read_crcb = fp_div(ddr.ref_read_crcb,
+					   ref_cbcr_read_bw_factor);
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 		llc.ref_read_crcb = total_ref_read_crcb - ddr.ref_read_crcb;
 	}
 	}
 
 

+ 5 - 8
driver/vidc/src/msm_vidc_driver.c

@@ -995,17 +995,15 @@ int msm_vidc_state_change_streamoff(struct msm_vidc_inst *inst,
 		return 0;
 		return 0;
 
 
 	if (port == INPUT_PORT) {
 	if (port == INPUT_PORT) {
-		if (is_state(inst, MSM_VIDC_INPUT_STREAMING)) {
+		if (is_state(inst, MSM_VIDC_INPUT_STREAMING))
 			new_state = MSM_VIDC_OPEN;
 			new_state = MSM_VIDC_OPEN;
-		} else if (is_state(inst, MSM_VIDC_STREAMING)) {
+		else if (is_state(inst, MSM_VIDC_STREAMING))
 			new_state = MSM_VIDC_OUTPUT_STREAMING;
 			new_state = MSM_VIDC_OUTPUT_STREAMING;
-		}
 	} else if (port == OUTPUT_PORT) {
 	} else if (port == OUTPUT_PORT) {
-		if (is_state(inst, MSM_VIDC_OUTPUT_STREAMING)) {
+		if (is_state(inst, MSM_VIDC_OUTPUT_STREAMING))
 			new_state = MSM_VIDC_OPEN;
 			new_state = MSM_VIDC_OPEN;
-		} else if (is_state(inst, MSM_VIDC_STREAMING)) {
+		else if (is_state(inst, MSM_VIDC_STREAMING))
 			new_state = MSM_VIDC_INPUT_STREAMING;
 			new_state = MSM_VIDC_INPUT_STREAMING;
-		}
 	}
 	}
 	rc = msm_vidc_change_state(inst, new_state, __func__);
 	rc = msm_vidc_change_state(inst, new_state, __func__);
 	if (rc)
 	if (rc)
@@ -4436,9 +4434,8 @@ void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst)
 		dmabuf = dbuf->dmabuf;
 		dmabuf = dbuf->dmabuf;
 		if (dmabuf && dmabuf->file) {
 		if (dmabuf && dmabuf->file) {
 			f_inode = file_inode(dmabuf->file);
 			f_inode = file_inode(dmabuf->file);
-			if (f_inode) {
+			if (f_inode)
 				inode_num = f_inode->i_ino;
 				inode_num = f_inode->i_ino;
-			}
 		}
 		}
 		i_vpr_e(inst, "%s: removing dma_buf %p, inode %lu, refcount %u\n",
 		i_vpr_e(inst, "%s: removing dma_buf %p, inode %lu, refcount %u\n",
 			__func__, dbuf->dmabuf, inode_num, dbuf->refcount);
 			__func__, dbuf->dmabuf, inode_num, dbuf->refcount);

+ 1 - 2
driver/vidc/src/msm_vidc_fence.c

@@ -161,9 +161,8 @@ static void msm_vidc_fence_destroy(struct msm_vidc_inst *inst, u64 fence_id)
 	struct msm_vidc_fence *fence;
 	struct msm_vidc_fence *fence;
 
 
 	fence = msm_vidc_get_dma_fence_from_id(inst, fence_id);
 	fence = msm_vidc_get_dma_fence_from_id(inst, fence_id);
-	if (!fence) {
+	if (!fence)
 		return;
 		return;
-	}
 
 
 	i_vpr_l(inst, "%s: fence %s\n", __func__, fence->name);
 	i_vpr_l(inst, "%s: fence %s\n", __func__, fence->name);
 	list_del_init(&fence->list);
 	list_del_init(&fence->list);

+ 3 - 3
driver/vidc/src/msm_vidc_power.c

@@ -273,11 +273,11 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
 			 * 0 index - dpb colorformat
 			 * 0 index - dpb colorformat
 			 * 1 index - opb colorformat
 			 * 1 index - opb colorformat
 			 */
 			 */
-			if (is_10bit_colorformat(color_format)) {
+			if (is_10bit_colorformat(color_format))
 				vote_data->color_formats[0] = MSM_VIDC_FMT_TP10C;
 				vote_data->color_formats[0] = MSM_VIDC_FMT_TP10C;
-			} else {
+			else
 				vote_data->color_formats[0] = MSM_VIDC_FMT_NV12;
 				vote_data->color_formats[0] = MSM_VIDC_FMT_NV12;
-			}
+
 			vote_data->color_formats[1] = color_format;
 			vote_data->color_formats[1] = color_format;
 		} else if (inst->codec == MSM_VIDC_AV1 &&
 		} else if (inst->codec == MSM_VIDC_AV1 &&
 			inst->capabilities[FILM_GRAIN].value) {
 			inst->capabilities[FILM_GRAIN].value) {

+ 1 - 2
driver/vidc/src/msm_vidc_synx.c

@@ -99,9 +99,8 @@ static void msm_vidc_synx_fence_destroy(struct msm_vidc_inst *inst, u64 fence_id
 	struct msm_vidc_fence *fence;
 	struct msm_vidc_fence *fence;
 
 
 	fence = msm_vidc_get_synx_fence_from_id(inst, fence_id);
 	fence = msm_vidc_get_synx_fence_from_id(inst, fence_id);
-	if (!fence) {
+	if (!fence)
 		return;
 		return;
-	}
 
 
 	i_vpr_e(inst, "%s: fence %s\n", __func__, fence->name);
 	i_vpr_e(inst, "%s: fence %s\n", __func__, fence->name);
 	list_del_init(&fence->list);
 	list_del_init(&fence->list);

+ 1 - 2
driver/vidc/src/msm_vidc_v4l2.c

@@ -39,9 +39,8 @@ unsigned int msm_v4l2_poll(struct file *filp, struct poll_table_struct *pt)
 		goto exit;
 		goto exit;
 	}
 	}
 	poll = msm_vidc_poll((void *)inst, filp, pt);
 	poll = msm_vidc_poll((void *)inst, filp, pt);
-	if (poll) {
+	if (poll)
 		goto exit;
 		goto exit;
-	}
 
 
 exit:
 exit:
 	put_inst(inst);
 	put_inst(inst);

+ 2 - 2
driver/vidc/src/msm_vidc_vb2.c

@@ -707,8 +707,8 @@ void msm_vb2_request_complete(struct vb2_buffer *vb)
 	}
 	}
 	inst = vb2_get_drv_priv(vb->vb2_queue);
 	inst = vb2_get_drv_priv(vb->vb2_queue);
 	if (!inst) {
 	if (!inst) {
-		 d_vpr_e("%s: invalid inst\n", __func__);
-		 return;
+		d_vpr_e("%s: invalid inst\n", __func__);
+		return;
 	}
 	}
 
 
 	i_vpr_l(inst, "%s: vb type %d, index %d\n",
 	i_vpr_l(inst, "%s: vb type %d, index %d\n",