extcon: remove redundant assignment to variable idx
authorColin Ian King <colin.king@canonical.com>
Wed, 15 Apr 2020 23:08:21 +0000 (00:08 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 29 May 2020 08:36:01 +0000 (17:36 +0900)
The variable idx is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon.c

index 2dfbfec..0a6438c 100644 (file)
@@ -900,7 +900,7 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
                             struct notifier_block *nb)
 {
        unsigned long flags;
-       int ret, idx = -EINVAL;
+       int ret, idx;
 
        if (!edev || !nb)
                return -EINVAL;