Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbcJMNeP (ORCPT ); Thu, 13 Oct 2016 09:34:15 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:57481 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbcJMNeC (ORCPT ); Thu, 13 Oct 2016 09:34:02 -0400 From: Geert Uytterhoeven To: Sean Young , Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [media] rc: Fix uninitialized variable in debug print Date: Thu, 13 Oct 2016 12:35:02 +0200 Message-Id: <1476354902-16151-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1071 Lines: 28 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 --- 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