From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbcGNNEf (ORCPT ); Thu, 14 Jul 2016 09:04:35 -0400 Received: from mail.rapiddevelopmentkit.de ([217.6.246.34]:60643 "EHLO root.phytec.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbcGNNEe (ORCPT ); Thu, 14 Jul 2016 09:04:34 -0400 Message-ID: <1468501472.4873.27.camel@lws-tremmet.phytec.de> Subject: Re: [PATCH] mtd: nand: omap2: add missing braces From: Teresa Remmet To: Arnd Bergmann Cc: Brian Norris , Boris Brezillon , Richard Weinberger , David Woodhouse , Roger Quadros , Tony Lindgren , "Cooper Jr., Franklin" , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 14 Jul 2016 15:04:32 +0200 In-Reply-To: <20160714095416.739127-1-arnd@arndb.de> References: <20160714095416.739127-1-arnd@arndb.de> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP5 HF413|March 21, 2016) at 14.07.2016 15:04:32, Serialize by Router on Idefix/Phytec(Release 9.0.1FP5 HF413|March 21, 2016) at 14.07.2016 15:04:32, Serialize complete at 14.07.2016 15:04:32 X-TNEFEvaluated: 1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Am Donnerstag, den 14.07.2016, 11:53 +0200 schrieb Arnd Bergmann: > A bug fix just introduced incorrect behavior in the omap2 nand driver, as > found by gcc-6.1: > > drivers/mtd/nand/omap2.c: In function 'omap_get_dt_info': > drivers/mtd/nand/omap2.c:1658:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation] > if (!info->elm_of_node) > ^~ > drivers/mtd/nand/omap2.c:1660:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' > if (!info->elm_of_node) > ^~ > > We clearly need to put the indented code into { } braces to get the intended > behavior. how bad that I missed that :(. But nice that gcc-6.1 catches such things. Thanks, Teresa > > Signed-off-by: Arnd Bergmann > Fixes: 3bbca2c54f86 ("mtd: nand: omap2: Add check for old elm binding") > --- > drivers/mtd/nand/omap2.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c > index a36ad3d146a3..ab7c34096a62 100644 > --- a/drivers/mtd/nand/omap2.c > +++ b/drivers/mtd/nand/omap2.c > @@ -1655,10 +1655,11 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info) > > /* detect availability of ELM module. Won't be present pre-OMAP4 */ > info->elm_of_node = of_parse_phandle(child, "ti,elm-id", 0); > - if (!info->elm_of_node) > + if (!info->elm_of_node) { > info->elm_of_node = of_parse_phandle(child, "elm_id", 0); > if (!info->elm_of_node) > dev_dbg(dev, "ti,elm-id not in DT\n"); > + } > > /* select ecc-scheme for NAND */ > if (of_property_read_string(child, "ti,nand-ecc-opt", &s)) {