This patch fixes below compilation warning:-
drivers/extcon/extcon.c: In function extcon_register_notifier:
drivers/extcon/extcon.c:455:6: warning: idx may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   if (idx >= 0) {

Signed-off-by: Vaneet Narang <v.nar...@samsung.com>
Signed-off-by: Maninder Singh <maninder...@samsung.com>
---
 drivers/extcon/extcon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 8682efc..24f04c4 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -428,7 +428,7 @@ int extcon_register_notifier(struct extcon_dev *edev, 
unsigned int id,
                             struct notifier_block *nb)
 {
        unsigned long flags;
-       int ret, idx;
+       int ret, idx = -EINVAL;
 
        if (!nb)
                return -EINVAL;
-- 
1.7.9.5

Reply via email to