From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751090AbdALHtz (ORCPT ); Thu, 12 Jan 2017 02:49:55 -0500 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33974 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbdALHty (ORCPT ); Thu, 12 Jan 2017 02:49:54 -0500 MIME-Version: 1.0 In-Reply-To: <20170111143712.510147-1-arnd@arndb.de> References: <20170111143712.510147-1-arnd@arndb.de> From: Linus Walleij Date: Thu, 12 Jan 2017 08:49:52 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: amd: avoid maybe-uninitalized warning To: Arnd Bergmann Cc: "Agrawal, Nitesh-kumar" , Pankaj Sen , "Shah, Nehal-bakulchandra" , Shyam-sundar S-k , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2017 at 3:36 PM, Arnd Bergmann wrote: > Since gpio_dev->hwbank_num is now a variable, the compiler cannot > figure out if pin_num is initialized at all: > > 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] > > This adds a 'default' statement to make that case well-defined. > > Fixes: 3bfd44306c65 ("pinctrl: amd: Add support for additional GPIO") > Signed-off-by: Arnd Bergmann Patch applied. Yours, Linus Walleij