Message ID | 20210508105129.2698-1-paskripkin@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] staging: media: atomisp: code cleanup | expand |
On Sat, May 08, 2021 at 01:51:29PM +0300, Pavel Skripkin wrote: > Breaks are not useful after a return, they can > simply be removed. > > Also, dropped the individual return statements > after or inside switch cases Almost always, when you say "also" in a patch changelog, that means this should be split up into two different patches. I recommend doing that here as well, this should be a 2 patch series, right? thanks, greg k-h
Hi, Greg! On Sat, 8 May 2021 12:58:06 +0200 Greg KH <gregkh@linuxfoundation.org> wrote: > On Sat, May 08, 2021 at 01:51:29PM +0300, Pavel Skripkin wrote: > > Breaks are not useful after a return, they can > > simply be removed. > > > > Also, dropped the individual return statements > > after or inside switch cases > > Almost always, when you say "also" in a patch changelog, that means > this should be split up into two different patches. > I thought, I could add this to current patch, because It was suggested by maintainer, but, I guess, I was wrong :) > I recommend doing that here as well, this should be a 2 patch series, > right? > Thanks for suggestion! I will also remove returns at the end of void functions as 3rd patch in serie. > thanks, > > greg k-h 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..cbaaec620581 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 @@ -903,17 +903,10 @@ static input_system_err_t input_system_configure_channel( error = input_system_configure_channel_sensor(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 +988,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 +1024,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 +1310,6 @@ static input_system_err_t configuration_to_registers(void) default: return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; - break; } // end of switch (source_type) @@ -1695,19 +1685,11 @@ 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; } // Test flags and set structure.
Breaks are not useful after a return, they can simply be removed. Also, dropped the individual return statements after or inside switch cases Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> --- Changes in v2: dropped the individual return statements --- .../hive_isp_css_common/host/input_system.c | 18 ------------------ 1 file changed, 18 deletions(-)