* [PATCH] [media] rc: Fix uninitialized variable in debug print
@ 2016-10-13 10:35 Geert Uytterhoeven
2016-10-13 20:15 ` Sean Young
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2016-10-13 10:35 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab; +Cc: linux-kernel, Geert Uytterhoeven
drivers/media/i2c/ir-kbd-i2c.c: In function ‘get_key_haup_common’:
drivers/media/i2c/ir-kbd-i2c.c:120: warning: ‘toggle’ is used uninitialized in this function
To fix this, use the intermediate "toggle" variable, like is done in
other branches.
Fixes: 00bb820755ed8ee9 ("[media] rc: Hauppauge z8f0811 can decode RC6")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/media/i2c/ir-kbd-i2c.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
index f95a6bc839d58f5f..0ab8e226c4cc0d19 100644
--- a/drivers/media/i2c/ir-kbd-i2c.c
+++ b/drivers/media/i2c/ir-kbd-i2c.c
@@ -114,7 +114,8 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
vendor = get_unaligned_be16(buf + 1);
if (vendor == 0x800f) {
- *ptoggle = (dev & 0x80) != 0;
+ toggle = (dev & 0x80) != 0;
+ *ptoggle = toggle;
*protocol = RC_TYPE_RC6_MCE;
dev &= 0x7f;
dprintk(1, "ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [media] rc: Fix uninitialized variable in debug print
2016-10-13 10:35 [PATCH] [media] rc: Fix uninitialized variable in debug print Geert Uytterhoeven
@ 2016-10-13 20:15 ` Sean Young
0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2016-10-13 20:15 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Mauro Carvalho Chehab, linux-kernel
On Thu, Oct 13, 2016 at 12:35:02PM +0200, Geert Uytterhoeven wrote:
> drivers/media/i2c/ir-kbd-i2c.c: In function ‘get_key_haup_common’:
> drivers/media/i2c/ir-kbd-i2c.c:120: warning: ‘toggle’ is used uninitialized in this function
>
> To fix this, use the intermediate "toggle" variable, like is done in
> other branches.
>
> Fixes: 00bb820755ed8ee9 ("[media] rc: Hauppauge z8f0811 can decode RC6")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks for finding this and writing a patch.
Acked-by: Sean Young <sean@mess.org>
> ---
> drivers/media/i2c/ir-kbd-i2c.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
> index f95a6bc839d58f5f..0ab8e226c4cc0d19 100644
> --- a/drivers/media/i2c/ir-kbd-i2c.c
> +++ b/drivers/media/i2c/ir-kbd-i2c.c
> @@ -114,7 +114,8 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
> vendor = get_unaligned_be16(buf + 1);
>
> if (vendor == 0x800f) {
> - *ptoggle = (dev & 0x80) != 0;
> + toggle = (dev & 0x80) != 0;
> + *ptoggle = toggle;
> *protocol = RC_TYPE_RC6_MCE;
> dev &= 0x7f;
> dprintk(1, "ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n",
> --
> 1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-13 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13 10:35 [PATCH] [media] rc: Fix uninitialized variable in debug print Geert Uytterhoeven
2016-10-13 20:15 ` 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).