From patchwork Mon Dec 8 12:09:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5455701 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 28E489F1C5 for ; Mon, 8 Dec 2014 12:10:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D1F42015A for ; Mon, 8 Dec 2014 12:10:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 385D02017D for ; Mon, 8 Dec 2014 12:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbaLHMKC (ORCPT ); Mon, 8 Dec 2014 07:10:02 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:50894 "EHLO mail-qa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753229AbaLHMKC (ORCPT ); Mon, 8 Dec 2014 07:10:02 -0500 Received: by mail-qa0-f48.google.com with SMTP id v10so3265459qac.35 for ; Mon, 08 Dec 2014 04:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7aIF86esQcG3/Poo+xQ7sJnZ6qRSrabTRVh8Ns14RZ8=; b=tNqy8xzXZYuO0tSMdbVysIXiG8jx7Uyr67H+PxUMPJVCW9BdarCQzGffuojqfLjKG9 nJHM6s+8/y1T8EZd6QZ6HWEgckdIMjWBlgT4Bm24jOVzLM+36T5g6CUyneTZVnoeE7xG 1kd+a88Nt5Jz0tUq7xu0rHe3PTlh45D+7o5s+pleNyadEsUAuU5nMUahEPdY47IOX3JD xaXaPcbIH6ar5e6orGfZFr4De/J06OcenctfgLy2XR07ScyC8aRhxizfXlZiXRHiN5N9 tEWD6WgFoQIHYgP9JkatsBfL/pCeVDW51L1Z4hPGH8aZsvZ/5SmgmhKOAkoyb+yQ80cN 5iIQ== X-Received: by 10.140.84.111 with SMTP id k102mr50151084qgd.76.1418040600777; Mon, 08 Dec 2014 04:10:00 -0800 (PST) Received: from localhost.localdomain ([187.66.159.54]) by mx.google.com with ESMTPSA id t5sm37588705qge.16.2014.12.08.04.09.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Dec 2014 04:09:59 -0800 (PST) From: Fabio Estevam To: dmitry.torokhov@gmail.com Cc: alexander.stein@systec-electronic.com, linux-input@vger.kernel.org, Fabio Estevam Subject: [PATCH v2] Input: gpio_keys - initialize the 'irq' variable Date: Mon, 8 Dec 2014 10:09:44 -0200 Message-Id: <1418040584-5670-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Commit f2d347ff70be453e ("Input: gpio_keys - add device tree support for interrupt only keys") caused the following build warning: drivers/input/keyboard/gpio_keys.c: In function 'gpio_keys_probe': drivers/input/keyboard/gpio_keys.c:647:15: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/input/keyboard/gpio_keys.c:622:7: note: 'irq' was declared here To fix this warning, do the 'irq' assignment inside the 'if' block that it is actually used. Reported-by: Olof's autobuilder Signed-off-by: Fabio Estevam --- Change since v1: - Do the 'irq' assignment inside the 'if' block that it is actually used. drivers/input/keyboard/gpio_keys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index aa13055..6c33849 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -619,11 +619,12 @@ gpio_keys_get_devtree_pdata(struct device *dev) i = 0; for_each_child_of_node(node, pp) { int gpio = -1; - int irq; enum of_gpio_flags flags; if (!of_find_property(pp, "gpios", NULL)) { - irq = irq_of_parse_and_map(pp, 0); + int irq = irq_of_parse_and_map(pp, 0); + + button->irq = irq; if (irq == 0) { pdata->nbuttons--; dev_warn(dev, "Found button without gpios or irqs\n"); @@ -644,7 +645,6 @@ gpio_keys_get_devtree_pdata(struct device *dev) button = &pdata->buttons[i++]; button->gpio = gpio; - button->irq = irq; button->active_low = flags & OF_GPIO_ACTIVE_LOW; if (of_property_read_u32(pp, "linux,code", &button->code)) {