Message ID | 20210506200956.16593-1-paskripkin@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | staging: media: atomisp: remove useless breaks | expand |
Hi Pavel, On Thu, May 06, 2021 at 11:09:56PM +0300, Pavel Skripkin wrote: > Breaks are not useful after a return, they can > simply be removed. > > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> > --- > .../pci/hive_isp_css_common/host/input_system.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > index 0f5a231672a8..fd82997b11cc 100644 > --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > @@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel( > break; > case INPUT_SYSTEM_SOURCE_TPG: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > case INPUT_SYSTEM_SOURCE_PRBS: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > case INPUT_SYSTEM_SOURCE_FIFO: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; While at it, you could drop the individual return statements, too. There seems to be another such location at the end of the patch. > - break; > default: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > } > > if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error; > @@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void) > default: > config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT; > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > } > > // Check acquisition buffer specified but set it later since it has to be unique. > @@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void) > > default: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > } > } else { > config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED; > @@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void) > > default: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > > } // end of switch (source_type) > > @@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor( > break; > case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > case INPUT_SYSTEM_XMEM_CAPTURE: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > case INPUT_SYSTEM_XMEM_ACQUIRE: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > default: > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > - break; > } > return INPUT_SYSTEM_ERR_NO_ERROR; > }
On Fri, 7 May 2021 10:54:58 +0300 Sakari Ailus <sakari.ailus@linux.intel.com> wrote: Hi, Sakari! > Hi Pavel, > > On Thu, May 06, 2021 at 11:09:56PM +0300, Pavel Skripkin wrote: > > Breaks are not useful after a return, they can > > simply be removed. > > > > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> > > --- > > .../pci/hive_isp_css_common/host/input_system.c | 11 > > ----------- 1 file changed, 11 deletions(-) > > > > diff --git > > a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > > b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > > index 0f5a231672a8..fd82997b11cc 100644 --- > > a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > > +++ > > b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c > > @@ -904,16 +904,12 @@ static input_system_err_t > > input_system_configure_channel( break; case > > INPUT_SYSTEM_SOURCE_TPG: return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > case INPUT_SYSTEM_SOURCE_PRBS: > > return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > case INPUT_SYSTEM_SOURCE_FIFO: > > return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > While at it, you could drop the individual return statements, too. > There seems to be another such location at the end of the patch. > Good catch, I will remove them in v2. Also, I noticed, that there are returns in the end of void functions. Can I remove them too in v2, or it should be done as another patch? > > - break; > > default: > > return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > } > > > > if (error != INPUT_SYSTEM_ERR_NO_ERROR) return > > error; @@ -995,7 +991,6 @@ static input_system_err_t > > input_buffer_configuration(void) default: > > config.csi_buffer_flags[port] |= > > INPUT_SYSTEM_CFG_FLAG_CONFLICT; return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > } > > > > // Check acquisition buffer specified but > > set it later since it has to be unique. @@ -1032,7 +1027,6 @@ > > static input_system_err_t input_buffer_configuration(void) > > default: > > return > > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > } > > } else { > > config.csi_buffer_flags[port] = > > INPUT_SYSTEM_CFG_FLAG_BLOCKED; @@ -1319,7 +1313,6 @@ static > > input_system_err_t configuration_to_registers(void) > > default: > > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > > > } // end of switch (source_type) > > > > @@ -1696,16 +1689,12 @@ static input_system_err_t > > input_system_configure_channel_sensor( break; > > case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING: > > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > case INPUT_SYSTEM_XMEM_CAPTURE: > > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > case INPUT_SYSTEM_XMEM_ACQUIRE: > > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > default: > > return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; > > - break; > > } > > return INPUT_SYSTEM_ERR_NO_ERROR; > > } > With regards, Pavel Skripkin
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c index 0f5a231672a8..fd82997b11cc 100644 --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c @@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel( break; case INPUT_SYSTEM_SOURCE_TPG: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; case INPUT_SYSTEM_SOURCE_PRBS: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; case INPUT_SYSTEM_SOURCE_FIFO: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; default: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error; @@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void) default: config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT; return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } // Check acquisition buffer specified but set it later since it has to be unique. @@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void) default: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } } else { config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED; @@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void) default: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } // end of switch (source_type) @@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor( break; case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; case INPUT_SYSTEM_XMEM_CAPTURE: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; case INPUT_SYSTEM_XMEM_ACQUIRE: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; default: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } return INPUT_SYSTEM_ERR_NO_ERROR; }
Breaks are not useful after a return, they can simply be removed. Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> --- .../pci/hive_isp_css_common/host/input_system.c | 11 ----------- 1 file changed, 11 deletions(-)