]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: typec: mux: remove redundant check on variable match
authorColin Ian King <colin.king@canonical.com>
Tue, 19 Feb 2019 13:43:33 +0000 (13:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 10:29:01 +0000 (11:29 +0100)
All the code paths that lead to the return statement are where
match is always true, hence the check to see if it is true is
redundant and can be removed.

Detected by CoverityScan, CID#14769672 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux.c

index 54d74978df9ce3a4d6458ec5c1776155d2ba03ef..2ce54f3fc79c3af74094baebe073060c98e07f49 100644 (file)
@@ -184,7 +184,7 @@ static void *typec_mux_match(struct device_connection *con, int ep, void *data)
                if (dev_fwnode(mux->dev) == con->fwnode)
                        return mux;
 
-       return match ? ERR_PTR(-EPROBE_DEFER) : NULL;
+       return ERR_PTR(-EPROBE_DEFER);
 }
 
 /**