[PATCH] firmware: arm_scmi: return a literal instead of a variable

Dan Carpenter error27 at gmail.com
Wed Feb 22 07:17:06 PST 2023


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 at 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 */
-- 
2.39.1




More information about the linux-arm-kernel mailing list