public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] extcon: fixing compile time warning
@ 2016-08-01  9:21 ` Maninder Singh
  2016-08-01  9:38   ` Chanwoo Choi
  0 siblings, 1 reply; 2+ messages in thread
From: Maninder Singh @ 2016-08-01  9:21 UTC (permalink / raw)
  To: myungjoo.ham, cw00.choi
  Cc: linux-kernel, pankaj.m, Maninder Singh, Vaneet Narang

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.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] extcon: fixing compile time warning
  2016-08-01  9:21 ` [PATCH 1/1] extcon: fixing compile time warning Maninder Singh
@ 2016-08-01  9:38   ` Chanwoo Choi
  0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2016-08-01  9:38 UTC (permalink / raw)
  To: Maninder Singh, myungjoo.ham; +Cc: linux-kernel, pankaj.m, Vaneet Narang

On 2016년 08월 01일 18:21, Maninder Singh wrote:
> 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.narang@samsung.com>
> Signed-off-by: Maninder Singh <maninder1.s@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;
> 

Applied it.

Thanks,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-01 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20160801093306epcas1p2a3a02973b4bf532bf878bf0dabfffdea@epcas1p2.samsung.com>
2016-08-01  9:21 ` [PATCH 1/1] extcon: fixing compile time warning Maninder Singh
2016-08-01  9:38   ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox