firmware: arm_scmi: Return a literal instead of a variable
authorDan Carpenter <error27@gmail.com>
Wed, 22 Feb 2023 15:17:06 +0000 (18:17 +0300)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 6 Mar 2023 08:42:32 +0000 (08:42 +0000)
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>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/Y/Yx8pOdf8rNhPVe@kili
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/bus.c

index 73140b8..ac306ca 100644 (file)
@@ -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 */