Skip to content

Commit 5b552b1

Browse files
committed
media: atomisp: re-enable warnings again
For most warnings, the current code is OK. There are still some issues with implicit-fallthough warnings. Solve those and re-enable all warnings for this driver. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent fb1f6ae commit 5b552b1

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

drivers/staging/media/atomisp/Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,3 @@ DEFINES += -DISP2400 -DSYSTEM_hive_isp_css_2400_system
344344
endif
345345

346346
ccflags-y += $(INCLUDES) $(DEFINES) -fno-common
347-
348-
# HACK! While this driver is in bad shape, don't enable several warnings
349-
# that would be otherwise enabled with W=1
350-
ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
351-
ccflags-y += $(call cc-disable-warning, missing-prototypes)
352-
ccflags-y += $(call cc-disable-warning, missing-declarations)
353-
ccflags-y += $(call cc-disable-warning, suggest-attribute=format)
354-
ccflags-y += $(call cc-disable-warning, unused-const-variable)
355-
ccflags-y += $(call cc-disable-warning, unused-but-set-variable)

drivers/staging/media/atomisp/pci/atomisp_cmd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4967,13 +4967,14 @@ enum mipi_port_id __get_mipi_port(struct atomisp_device *isp,
49674967
{
49684968
switch (port) {
49694969
case ATOMISP_CAMERA_PORT_PRIMARY:
4970-
return MIPI_PORT0_ID;
4970+
return MIPI_PORT0_ID;
49714971
case ATOMISP_CAMERA_PORT_SECONDARY:
49724972
return MIPI_PORT1_ID;
49734973
case ATOMISP_CAMERA_PORT_TERTIARY:
4974-
if (MIPI_PORT1_ID + 1 != N_MIPI_PORT_ID)
4974+
if (MIPI_PORT1_ID + 1 != N_MIPI_PORT_ID) {
49754975
return MIPI_PORT1_ID + 1;
4976-
/* go through down for else case */
4976+
}
4977+
/* fall through */
49774978
default:
49784979
dev_err(isp->dev, "unsupported port: %d\n", port);
49794980
return MIPI_PORT0_ID;

drivers/staging/media/atomisp/pci/atomisp_compat_css20.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -690,22 +690,23 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd,
690690
case ATOMISP_RUN_MODE_STILL_CAPTURE:
691691
if (pipe_id == IA_CSS_PIPE_ID_CAPTURE)
692692
return true;
693-
else
694-
return false;
693+
694+
return false;
695695
case ATOMISP_RUN_MODE_PREVIEW:
696696
if (!asd->continuous_mode->val) {
697697
if (pipe_id == IA_CSS_PIPE_ID_PREVIEW)
698698
return true;
699-
else
700-
return false;
699+
700+
return false;
701701
}
702-
/* fall through to ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE */
702+
/* fall-through */
703703
case ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE:
704704
if (pipe_id == IA_CSS_PIPE_ID_CAPTURE ||
705705
pipe_id == IA_CSS_PIPE_ID_PREVIEW)
706706
return true;
707-
else
708-
return false;
707+
708+
return false;
709+
/* fall-through */
709710
case ATOMISP_RUN_MODE_VIDEO:
710711
if (!asd->continuous_mode->val) {
711712
if (pipe_id == IA_CSS_PIPE_ID_VIDEO ||
@@ -714,13 +715,13 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd,
714715
else
715716
return false;
716717
}
717-
/* fall through to ATOMISP_RUN_MODE_SDV */
718+
/* fall through */
718719
case ATOMISP_RUN_MODE_SDV:
719720
if (pipe_id == IA_CSS_PIPE_ID_CAPTURE ||
720721
pipe_id == IA_CSS_PIPE_ID_VIDEO)
721722
return true;
722-
else
723-
return false;
723+
724+
return false;
724725
}
725726

726727
return false;
@@ -2749,25 +2750,27 @@ static unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd,
27492750
if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO
27502751
|| asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER)
27512752
return IA_CSS_PIPE_ID_VIDEO;
2752-
else
2753-
return IA_CSS_PIPE_ID_CAPTURE;
2753+
2754+
return IA_CSS_PIPE_ID_CAPTURE;
27542755
case ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE:
27552756
if (asd->copy_mode)
27562757
return IA_CSS_PIPE_ID_COPY;
2758+
27572759
return IA_CSS_PIPE_ID_CAPTURE;
27582760
case ATOMISP_SUBDEV_PAD_SOURCE_VF:
2759-
if (!atomisp_is_mbuscode_raw(
2760-
asd->fmt[asd->capture_pad].fmt.code))
2761+
if (!atomisp_is_mbuscode_raw(asd->fmt[asd->capture_pad].fmt.code)) {
27612762
return IA_CSS_PIPE_ID_CAPTURE;
2763+
}
2764+
/* fall through */
27622765
case ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW:
27632766
if (asd->yuvpp_mode)
27642767
return IA_CSS_PIPE_ID_YUVPP;
27652768
if (asd->copy_mode)
27662769
return IA_CSS_PIPE_ID_COPY;
27672770
if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO)
27682771
return IA_CSS_PIPE_ID_VIDEO;
2769-
else
2770-
return IA_CSS_PIPE_ID_PREVIEW;
2772+
2773+
return IA_CSS_PIPE_ID_PREVIEW;
27712774
}
27722775
dev_warn(isp->dev,
27732776
"invalid source pad:%d, return default preview pipe index.\n",

drivers/staging/media/atomisp/pci/atomisp_v4l2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,9 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
11501150

11511151
switch (subdevs->type) {
11521152
case RAW_CAMERA:
1153-
raw_index = isp->input_cnt;
11541153
dev_dbg(isp->dev, "raw_index: %d\n", raw_index);
1155-
/* pass-though */
1154+
raw_index = isp->input_cnt;
1155+
/* fall through */
11561156
case SOC_CAMERA:
11571157
dev_dbg(isp->dev, "SOC_INDEX: %d\n", isp->input_cnt);
11581158
if (isp->input_cnt >= ATOM_ISP_MAX_INPUTS) {

drivers/staging/media/atomisp/pci/hmm/hmm_bo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
660660
break;
661661
}
662662

663+
/* fall through */
664+
663665
/*
664666
* if dynamic memory pool doesn't exist, need to free
665667
* pages to system directly.

drivers/staging/media/atomisp/pci/sh_css.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4507,6 +4507,7 @@ ia_css_pipe_dequeue_buffer(struct ia_css_pipe *pipe,
45074507
#endif
45084508
pipe->stop_requested = false;
45094509
}
4510+
/* fall through */
45104511
case IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME:
45114512
case IA_CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME:
45124513
frame = (struct ia_css_frame *)HOST_ADDRESS(ddr_buffer.kernel_ptr);

drivers/staging/media/atomisp/pci/sh_css_sp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,12 +1184,14 @@ sp_init_sp_stage(struct ia_css_pipeline_stage *stage,
11841184
break;
11851185
case IA_CSS_PIPELINE_BIN_COPY:
11861186
assert(false); /* TBI */
1187+
break;
11871188
case IA_CSS_PIPELINE_ISYS_COPY:
11881189
sh_css_sp_start_isys_copy(args->out_frame[0],
11891190
pipe_num, stage->max_input_width, if_config_index);
11901191
break;
11911192
case IA_CSS_PIPELINE_NO_FUNC:
11921193
assert(false);
1194+
break;
11931195
}
11941196
}
11951197

0 commit comments

Comments
 (0)