From patchwork Tue Jan 3 08:21:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 89621 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp7902442qgi; Tue, 3 Jan 2017 00:21:43 -0800 (PST) X-Received: by 10.99.122.17 with SMTP id v17mr110894020pgc.31.1483431703705; Tue, 03 Jan 2017 00:21:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si34806754plg.194.2017.01.03.00.21.43; Tue, 03 Jan 2017 00:21:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934448AbdACIVh (ORCPT + 25 others); Tue, 3 Jan 2017 03:21:37 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:35446 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934413AbdACIVY (ORCPT ); Tue, 3 Jan 2017 03:21:24 -0500 Received: by mail-lf0-f53.google.com with SMTP id b14so281070956lfg.2 for ; Tue, 03 Jan 2017 00:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=j3VuOEbSnxIQLPUrlM2jMF6LAcsYKUoQ/RdTfqjs7R0=; b=JHV89A2kAplggWaIpLl49yz9dPo9Zrkw4Q7+8v8W3Mn6A78dG2lSn1j1MUyha6tZLW R4DSILjiaSISahSDDXJoSUkMOKtRCUB6h7m9AsaWliuKwvKHGjQrGAMXfSHjgYQeI7Yz YTKJiXT37yNA82aJQnWsFbKw9KC/LOdOvLQ1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=j3VuOEbSnxIQLPUrlM2jMF6LAcsYKUoQ/RdTfqjs7R0=; b=VihSpkqOP6EEJWn0T/AS2P5Tz3s5i2jd12+oU+EAZUJlKMsc3sW/PdJQ1UBFVMebat QGvXB0DRn9BqdLIWJrk34aen1MSc4+Rm0Ti0RTREN3BnXW4EHqSI5GWnGJEdS33WB1bs vKvCeczFRYFUJ6Ra98c3GZCLzkfLAhyGDn3/AlM8oRT7oGXwFdI37ZbTF2aCAgv+ty+V e5JpGkm42/QUxn8HBCj648bwxelHfh2pq2O5+V2s1G6bXuDF44wbH3zch7YGF8CU53B0 potbHBW6/lKSWesYIYzbRS5Agz0R+y1RF9uwM9r/M7ctYEu9+2mZZuIstlj+3qRwAee5 1rhg== X-Gm-Message-State: AIkVDXI5lMmFFuylTzkWTVVOGib6ZJ7T9OpbSoHTRuntnIx2pe+m7AIoKnJjrGnvAtoJm7SY X-Received: by 10.46.74.9 with SMTP id x9mr22922695lja.40.1483431681747; Tue, 03 Jan 2017 00:21:21 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id 10sm16339593ljh.11.2017.01.03.00.21.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 00:21:21 -0800 (PST) From: Linus Walleij To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-gpio@vger.kernel.org, Linus Walleij , S-k Shyam-sundar , Nehal Shah Subject: [PATCH] pinctrl: amd: fix compilation warning Date: Tue, 3 Jan 2017 09:21:19 +0100 Message-Id: <20170103082119.11958-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3bfd44306c65 ("pinctrl: amd: Add support for additional GPIO") created the following warning: drivers/pinctrl/pinctrl-amd.c: In function 'amd_gpio_dbg_show': drivers/pinctrl/pinctrl-amd.c:210:3: warning: 'pin_num' may be used uninitialized in this function [-Wmaybe-uninitialized] for (; i < pin_num; i++) { ^ drivers/pinctrl/pinctrl-amd.c:172:21: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized] unsigned int bank, i, pin_num; ^ Fix this by adding a guarding default case for illegal bank numbers. Cc: S-k Shyam-sundar Cc: Nehal Shah Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-amd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.9.3 diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 47b17100410e..c2203699f1ab 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -206,6 +206,9 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc) i = 192; pin_num = AMD_GPIO_PINS_BANK3 + i; break; + default: + /* Illegal bank number, ignore */ + continue; } for (; i < pin_num; i++) { seq_printf(s, "pin%d\t", i);