diff mbox series

firmware: arm_scmi: return a literal instead of a variable

Message ID Y/Yx8pOdf8rNhPVe@kili (mailing list archive)
State New, archived
Headers show
Series firmware: arm_scmi: return a literal instead of a variable | expand

Commit Message

Dan Carpenter Feb. 22, 2023, 3:17 p.m. UTC
In this context "return scmi_dev;" and "return NULL;" are equivalent
but it is more readable to return a literal.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/firmware/arm_scmi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cristian Marussi Feb. 23, 2023, 12:28 p.m. UTC | #1
On Wed, Feb 22, 2023 at 06:17:06PM +0300, Dan Carpenter wrote:
> In this context "return scmi_dev;" and "return NULL;" are equivalent
> but it is more readable to return a literal.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
>  drivers/firmware/arm_scmi/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index 73140b854b31..ac306ca48b07 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -436,7 +436,7 @@ struct scmi_device *scmi_device_create(struct device_node *np,
>  	/* Nothing to do. */
>  	if (!phead) {
>  		mutex_unlock(&scmi_requested_devices_mtx);
> -		return scmi_dev;
> +		return NULL;
>  	}
>  
>  	/* Walk the list of requested devices for protocol and create them */

LGTM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian
Sudeep Holla March 9, 2023, 2:10 p.m. UTC | #2
On Wed, 22 Feb 2023 18:17:06 +0300, Dan Carpenter wrote:
> In this context "return scmi_dev;" and "return NULL;" are equivalent
> but it is more readable to return a literal.
> 

Applied to sudeep.holla/linux (for-next/scmi/fixes), thanks!

[1/1] firmware: arm_scmi: return a literal instead of a variable
      https://git.kernel.org/sudeep.holla/c/6bed395d7db2
--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 73140b854b31..ac306ca48b07 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -436,7 +436,7 @@  struct scmi_device *scmi_device_create(struct device_node *np,
 	/* Nothing to do. */
 	if (!phead) {
 		mutex_unlock(&scmi_requested_devices_mtx);
-		return scmi_dev;
+		return NULL;
 	}
 
 	/* Walk the list of requested devices for protocol and create them */