diff mbox series

media: atomisp: restore missing 'return' statement

Message ID 20210802143820.1150099-1-arnd@kernel.org (mailing list archive)
State New, archived
Headers show
Series media: atomisp: restore missing 'return' statement | expand

Commit Message

Arnd Bergmann Aug. 2, 2021, 2:38 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The input_system_configure_channel_sensor() function lost its final
return code in a previous patch:

drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]

Restore what was there originally.

Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../media/atomisp/pci/hive_isp_css_common/host/input_system.c   | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sakari Ailus Aug. 2, 2021, 3:36 p.m. UTC | #1
On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The input_system_configure_channel_sensor() function lost its final
> return code in a previous patch:
> 
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> 
> Restore what was there originally.
> 
> Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Kees Cook Aug. 13, 2021, 4:38 p.m. UTC | #2
On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The input_system_configure_channel_sensor() function lost its final
> return code in a previous patch:
> 
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> 
> Restore what was there originally.
> 
> Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I hit this too. Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  .../media/atomisp/pci/hive_isp_css_common/host/input_system.c   | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 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 8e085dda0c18..712e01c37870 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
> @@ -1646,6 +1646,8 @@ static input_system_err_t input_system_configure_channel_sensor(
>  	default:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
>  	}
> +
> +	return INPUT_SYSTEM_ERR_NO_ERROR;
>  }
>  
>  // Test flags and set structure.
> -- 
> 2.29.2
>
Andy Shevchenko Aug. 19, 2021, 5:24 p.m. UTC | #3
On Fri, Aug 13, 2021 at 7:39 PM Kees Cook <keescook@chromium.org> wrote:
>
> On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The input_system_configure_channel_sensor() function lost its final
> > return code in a previous patch:
> >
> > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> >
> > Restore what was there originally.
> >
> > Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> I hit this too. Thanks!
>
> Reviewed-by: Kees Cook <keescook@chromium.org>

Me too,
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Pavel, how have you tested it?
Pavel Skripkin Aug. 19, 2021, 7:22 p.m. UTC | #4
On 8/19/21 8:24 PM, Andy Shevchenko wrote:
> On Fri, Aug 13, 2021 at 7:39 PM Kees Cook <keescook@chromium.org> wrote:
>>
>> On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:
>> > From: Arnd Bergmann <arnd@arndb.de>
>> >
>> > The input_system_configure_channel_sensor() function lost its final
>> > return code in a previous patch:
>> >
>> > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
>> > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
>> >
>> > Restore what was there originally.
>> >
>> > Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
>> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> I hit this too. Thanks!
>>
>> Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> Me too,
> Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> Pavel, how have you tested it?
> 

To he honest, I didn't test it at all. It was part of application 
processes to LFX mentoship. I really don't like style changes. Anyway, I 
have to do it to pass the task, so, yeah, I messed up with this one ;(

Also, I didn't notice when patch was applied, because I was like 2 month 
after v3 posted. I am so sorry for this situation. Nowadays I always 
test my patches.

I was young and foolish :)


With regards,
Pavel Skripkin
Kees Cook Aug. 21, 2021, 5:53 a.m. UTC | #5
On Thu, Aug 19, 2021 at 08:24:11PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 13, 2021 at 7:39 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > The input_system_configure_channel_sensor() function lost its final
> > > return code in a previous patch:
> > >
> > > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> > > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> > >
> > > Restore what was there originally.
> > >
> > > Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > I hit this too. Thanks!
> >
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> Me too,
> Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Mauro, are you able to get this into your tree, please? Or Greg? It's in
staging. :) This is breaking the build.
Mauro Carvalho Chehab Aug. 21, 2021, 6:36 a.m. UTC | #6
Em Fri, 20 Aug 2021 22:53:37 -0700
Kees Cook <keescook@chromium.org> escreveu:

> On Thu, Aug 19, 2021 at 08:24:11PM +0300, Andy Shevchenko wrote:
> > On Fri, Aug 13, 2021 at 7:39 PM Kees Cook <keescook@chromium.org> wrote:  
> > >
> > > On Mon, Aug 02, 2021 at 04:38:14PM +0200, Arnd Bergmann wrote:  
> > > > From: Arnd Bergmann <arnd@arndb.de>
> > > >
> > > > The input_system_configure_channel_sensor() function lost its final
> > > > return code in a previous patch:
> > > >
> > > > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> > > > drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> > > >
> > > > Restore what was there originally.
> > > >
> > > > Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>  
> > >
> > > I hit this too. Thanks!
> > >
> > > Reviewed-by: Kees Cook <keescook@chromium.org>  
> > 
> > Me too,
> > Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>  
> 
> Mauro, are you able to get this into your tree, please? Or Greg? It's in
> staging. :) This is breaking the build.

Didn't notice it was breaking the build for you.

Patch applied, thanks!

Thanks,
Mauro
Praveen Kumar Sept. 24, 2021, 11:31 a.m. UTC | #7
On 02-08-2021 20:08, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The input_system_configure_channel_sensor() function lost its final
> return code in a previous patch:
> 
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
> 
> Restore what was there originally.
> 
> Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  .../media/atomisp/pci/hive_isp_css_common/host/input_system.c   | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 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 8e085dda0c18..712e01c37870 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
> @@ -1646,6 +1646,8 @@ static input_system_err_t input_system_configure_channel_sensor(
>  	default:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
>  	}
> +
> +	return INPUT_SYSTEM_ERR_NO_ERROR;

I would recommend to return "status" instead of INPUT_SYSTEM_ERR_NO_ERROR,
this will take care of sending correct return code, we encounter in different case statements.
Something like below would be better. Thanks.

-               return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
+               status = INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
        }
+       return status;

Regards,

~Praveen.
Praveen Kumar Sept. 24, 2021, 11:42 a.m. UTC | #8
On 24-09-2021 17:01, Praveen Kumar wrote:
> On 02-08-2021 20:08, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The input_system_configure_channel_sensor() function lost its final
>> return code in a previous patch:
>>
>> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c: In function 'input_system_configure_channel_sensor':
>> drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c:1649:1: error: control reaches end of non-void function [-Werror=return-type]
>>
>> Restore what was there originally.
>>
>> Fixes: 728a5c64ae5f ("media: atomisp: remove dublicate code")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  .../media/atomisp/pci/hive_isp_css_common/host/input_system.c   | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> 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 8e085dda0c18..712e01c37870 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
>> @@ -1646,6 +1646,8 @@ static input_system_err_t input_system_configure_channel_sensor(
>>  	default:
>>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
>>  	}
>> +
>> +	return INPUT_SYSTEM_ERR_NO_ERROR;
> 
> I would recommend to return "status" instead of INPUT_SYSTEM_ERR_NO_ERROR,
> this will take care of sending correct return code, we encounter in different case statements.
> Something like below would be better. Thanks.
> 
> -               return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> +               status = INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
>         }
> +       return status;

Please ignore this comment. My bad, we don't reach anytime here during failure.

Regards,

~Praveen.
diff mbox series

Patch

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 8e085dda0c18..712e01c37870 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
@@ -1646,6 +1646,8 @@  static input_system_err_t input_system_configure_channel_sensor(
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	}
+
+	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
 
 // Test flags and set structure.