From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Subject: Re: [RESEND PATCH v3 05/11] mtd: rawnand: vf610_nfc: add initializer to avoid -Wmaybe-uninitialized Date: Thu, 2 May 2019 16:13:46 +0200 Message-ID: <20190502161346.07c15187@xps13> References: <20190423034959.13525-1-yamada.masahiro@socionext.com> <20190423034959.13525-6-yamada.masahiro@socionext.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <20190423034959.13525-6-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org To: Masahiro Yamada Cc: Andrew Morton , linux-arch , Christophe Leroy , linux-s390@vger.kernel.org, Arnd Bergmann , Mathieu Malaterre , x86@kernel.org, Heiko Carstens , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , linux-mtd@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org List-Id: linux-arch.vger.kernel.org Hi Masahiro, Masahiro Yamada wrote on Tue, 23 Apr 2019 12:49:53 +0900: > This prepares to move CONFIG_OPTIMIZE_INLINING from x86 to a common > place. We need to eliminate potential issues beforehand. > > Kbuild test robot has never reported -Wmaybe-uninitialized warning > for this probably because vf610_nfc_run() is inlined by the x86 > compiler's inlining heuristic. > > If CONFIG_OPTIMIZE_INLINING is enabled for a different architecture > and vf610_nfc_run() is not inlined, the following warning is reported: > > drivers/mtd/nand/raw/vf610_nfc.c: In function ‘vf610_nfc_cmd’: > drivers/mtd/nand/raw/vf610_nfc.c:455:3: warning: ‘offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] > vf610_nfc_rd_from_sram(instr->ctx.data.buf.in + offset, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > nfc->regs + NFC_MAIN_AREA(0) + offset, > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > trfr_sz, !nfc->data_access); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMHO this patch has no dependencies with this series. Would you mind sending it alone with the proper Fixes tag? > > Signed-off-by: Masahiro Yamada > --- > > Changes in v3: None > Changes in v2: > - split into a separate patch > > drivers/mtd/nand/raw/vf610_nfc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c > index a662ca1970e5..19792d725ec2 100644 > --- a/drivers/mtd/nand/raw/vf610_nfc.c > +++ b/drivers/mtd/nand/raw/vf610_nfc.c > @@ -364,7 +364,7 @@ static int vf610_nfc_cmd(struct nand_chip *chip, > { > const struct nand_op_instr *instr; > struct vf610_nfc *nfc = chip_to_nfc(chip); > - int op_id = -1, trfr_sz = 0, offset; > + int op_id = -1, trfr_sz = 0, offset = 0; > u32 col = 0, row = 0, cmd1 = 0, cmd2 = 0, code = 0; > bool force8bit = false; > Thanks, Miquèl From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54991 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbfEBONy (ORCPT ); Thu, 2 May 2019 10:13:54 -0400 Date: Thu, 2 May 2019 16:13:46 +0200 From: Miquel Raynal Subject: Re: [RESEND PATCH v3 05/11] mtd: rawnand: vf610_nfc: add initializer to avoid -Wmaybe-uninitialized Message-ID: <20190502161346.07c15187@xps13> In-Reply-To: <20190423034959.13525-6-yamada.masahiro@socionext.com> References: <20190423034959.13525-1-yamada.masahiro@socionext.com> <20190423034959.13525-6-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-arch-owner@vger.kernel.org List-ID: To: Masahiro Yamada Cc: Andrew Morton , linux-arch , Christophe Leroy , linux-s390@vger.kernel.org, Arnd Bergmann , Mathieu Malaterre , x86@kernel.org, Heiko Carstens , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , linux-mtd@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Message-ID: <20190502141346.bKlRwbnqm22Zm8SWtFtsOFRqcjmiQGQA-lp8fQIYJA4@z> Hi Masahiro, Masahiro Yamada wrote on Tue, 23 Apr 2019 12:49:53 +0900: > This prepares to move CONFIG_OPTIMIZE_INLINING from x86 to a common > place. We need to eliminate potential issues beforehand. > > Kbuild test robot has never reported -Wmaybe-uninitialized warning > for this probably because vf610_nfc_run() is inlined by the x86 > compiler's inlining heuristic. > > If CONFIG_OPTIMIZE_INLINING is enabled for a different architecture > and vf610_nfc_run() is not inlined, the following warning is reported: > > drivers/mtd/nand/raw/vf610_nfc.c: In function ‘vf610_nfc_cmd’: > drivers/mtd/nand/raw/vf610_nfc.c:455:3: warning: ‘offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] > vf610_nfc_rd_from_sram(instr->ctx.data.buf.in + offset, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > nfc->regs + NFC_MAIN_AREA(0) + offset, > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > trfr_sz, !nfc->data_access); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMHO this patch has no dependencies with this series. Would you mind sending it alone with the proper Fixes tag? > > Signed-off-by: Masahiro Yamada > --- > > Changes in v3: None > Changes in v2: > - split into a separate patch > > drivers/mtd/nand/raw/vf610_nfc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c > index a662ca1970e5..19792d725ec2 100644 > --- a/drivers/mtd/nand/raw/vf610_nfc.c > +++ b/drivers/mtd/nand/raw/vf610_nfc.c > @@ -364,7 +364,7 @@ static int vf610_nfc_cmd(struct nand_chip *chip, > { > const struct nand_op_instr *instr; > struct vf610_nfc *nfc = chip_to_nfc(chip); > - int op_id = -1, trfr_sz = 0, offset; > + int op_id = -1, trfr_sz = 0, offset = 0; > u32 col = 0, row = 0, cmd1 = 0, cmd2 = 0, code = 0; > bool force8bit = false; > Thanks, Miquèl