Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756307AbcJMUYf (ORCPT ); Thu, 13 Oct 2016 16:24:35 -0400 Received: from gofer.mess.org ([80.229.237.210]:43197 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbcJMUY1 (ORCPT ); Thu, 13 Oct 2016 16:24:27 -0400 X-Greylist: delayed 474 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Oct 2016 16:23:47 EDT Date: Thu, 13 Oct 2016 21:15:51 +0100 From: Sean Young To: Geert Uytterhoeven Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: Re: [PATCH] [media] rc: Fix uninitialized variable in debug print Message-ID: <20161013201551.GA21731@gofer.mess.org> References: <1476354902-16151-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1476354902-16151-1-git-send-email-geert@linux-m68k.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1279 Lines: 33 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 Thanks for finding this and writing a patch. Acked-by: Sean Young > --- > 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