From: Maninder Singh Date: Mon, 1 Aug 2016 09:21:30 +0000 (+0530) Subject: extcon: Fix compile time warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6e25baab5a0b2af2ebeb1d817ef94b11fc465fbd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git extcon: Fix compile time warning 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 Signed-off-by: Maninder Singh [cw00.choi : Modify the patch title using the a captical letter for first char] Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 5b61000cde26..9a266e5c7e10 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -391,7 +391,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;