linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ir-kbd-i2c: fix uninitialized variable reference
@ 2016-11-10  7:45 Hans Verkuil
  2016-11-10 14:18 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2016-11-10  7:45 UTC (permalink / raw)
  To: Linux Media Mailing List

Fix compiler warning about uninitialized variable reference:

ir-kbd-i2c.c: In function 'get_key_haup_common.isra.3':
ir-kbd-i2c.c:62:2: warning: 'toggle' may be used uninitialized in this function [-Wmaybe-uninitialized]
  printk(KERN_DEBUG MODULE_NAME ": " fmt , ## arg)
  ^~~~~~
ir-kbd-i2c.c:70:20: note: 'toggle' was declared here
  int start, range, toggle, dev, code, ircode, vendor;
                    ^~~~~~

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
---
diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
index f95a6bc..cede397 100644
--- a/drivers/media/i2c/ir-kbd-i2c.c
+++ b/drivers/media/i2c/ir-kbd-i2c.c
@@ -118,7 +118,7 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
 			*protocol = RC_TYPE_RC6_MCE;
 			dev &= 0x7f;
 			dprintk(1, "ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n",
-						toggle, vendor, dev, code);
+						*ptoggle, vendor, dev, code);
 		} else {
 			*ptoggle = 0;
 			*protocol = RC_TYPE_RC6_6A_32;

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

* Re: [PATCH] ir-kbd-i2c: fix uninitialized variable reference
  2016-11-10  7:45 [PATCH] ir-kbd-i2c: fix uninitialized variable reference Hans Verkuil
@ 2016-11-10 14:18 ` Sean Young
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2016-11-10 14:18 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Linux Media Mailing List

On Thu, Nov 10, 2016 at 08:45:24AM +0100, Hans Verkuil wrote:
> Fix compiler warning about uninitialized variable reference:
> 
> ir-kbd-i2c.c: In function 'get_key_haup_common.isra.3':
> ir-kbd-i2c.c:62:2: warning: 'toggle' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   printk(KERN_DEBUG MODULE_NAME ": " fmt , ## arg)
>   ^~~~~~
> ir-kbd-i2c.c:70:20: note: 'toggle' was declared here
>   int start, range, toggle, dev, code, ircode, vendor;
>                     ^~~~~~

Again this patch already exists (which does exactly the same).

https://patchwork.linuxtv.org/patch/37930/


Sean

> 
> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
> ---
> diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
> index f95a6bc..cede397 100644
> --- a/drivers/media/i2c/ir-kbd-i2c.c
> +++ b/drivers/media/i2c/ir-kbd-i2c.c
> @@ -118,7 +118,7 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
>  			*protocol = RC_TYPE_RC6_MCE;
>  			dev &= 0x7f;
>  			dprintk(1, "ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n",
> -						toggle, vendor, dev, code);
> +						*ptoggle, vendor, dev, code);
>  		} else {
>  			*ptoggle = 0;
>  			*protocol = RC_TYPE_RC6_6A_32;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10  7:45 [PATCH] ir-kbd-i2c: fix uninitialized variable reference Hans Verkuil
2016-11-10 14:18 ` Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).