From 6c073dabce18f600d9422f8921df8364bf850fff Mon Sep 17 00:00:00 2001 From: David Kershner Date: Wed, 27 Sep 2017 13:14:35 -0400 Subject: [PATCH] staging: unisys: visorbus: keep the success path on the left side If you can't find the dev, it is an error. Indent for the error, instead of the success. Signed-off-by: David Kershner Reviewed-by: Tim Sell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorbus/visorchipset.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 416e74147141..80a078128bd1 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -309,7 +309,6 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, { struct device *dev; struct device *dev_start = NULL; - struct visor_device *vdev = NULL; struct visor_busdev id = { .bus_no = bus_no, .dev_no = dev_no @@ -319,9 +318,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, dev_start = &from->device; dev = bus_find_device(&visorbus_type, dev_start, (void *)&id, match_visorbus_dev_by_id); - if (dev) - vdev = to_visor_device(dev); - return vdev; + if (!dev) + return NULL; + return to_visor_device(dev); } static void controlvm_init_response(struct controlvm_message *msg, -- 2.39.5