Thread (9 messages) 9 messages, 7 authors, 2021-09-24

Re: [PATCH] media: atomisp: restore missing 'return' statement

From: Praveen Kumar <hidden>
Date: 2021-09-24 11:31:19
Also in: linux-media, lkml

On 02-08-2021 20:08, Arnd Bergmann wrote:
quoted hunk ↗ jump to hunk
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help