All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Ben Shelton <ben.shelton@ni.com>,
	David Woodhouse <dwmw2@infradead.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Punnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>
Subject: Re: [PATCH 1/3] mtd: nand: Add on-die ECC support
Date: Tue, 28 Apr 2015 01:15:49 +0200	[thread overview]
Message-ID: <553EC325.6060401@nod.at> (raw)
In-Reply-To: <CAN8TOE8Wx_KKy_2Lu_8j8iUaL+Q+rff_mR=P8E8tFzuQaYcWPg@mail.gmail.com>

Am 28.04.2015 um 01:10 schrieb Brian Norris:
> On Mon, Apr 27, 2015 at 3:57 PM, Richard Weinberger <richard@nod.at> wrote:
>> Am 28.04.2015 um 00:53 schrieb Brian Norris:
>>> On Tue, Apr 28, 2015 at 12:42:18AM +0200, Richard Weinberger wrote:
>>>> Am 28.04.2015 um 00:36 schrieb Ben Shelton:
>>>>>>> When I build this without CONFIG_MTD_NAND_ECC_ON_DIE enabled, I get the
>>>>>>> following warning here:
>>>>>>>
>>>>>>> In file included from drivers/mtd/nand/nand_base.c:46:0:
>>>>>>> include/linux/mtd/nand_ondie.h: In function 'nand_read_subpage_on_die':
>>>>>>> include/linux/mtd/nand_ondie.h:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
>>>>>>> include/linux/mtd/nand_ondie.h: In function 'nand_read_page_on_die':
>>>>>>> include/linux/mtd/nand_ondie.h:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
>>>>>>>
>>>>>>> Perhaps return an error code here, even though you'll never get past the BUG()?
>>>>>>
>>>>>> What gcc is this?
>>>>>> gcc 4.8 here does not warn, I thought it is smart enough that this function does never
>>>>>> return. Can it be that your .config has CONFIG_BUG=n?
>>>>>> Anyway, this functions clearly needs a return statement. :)
>>>>>
>>>>> gcc 4.7.2, and you are correct that I had CONFIG_BUG off.  :)
>>>>
>>>> Yeah, just noticed that BUG() with CONFIG_BUG=n does not have
>>>> a nonreturn attribute. So, gcc cannot know...
>>>
>>> But it's an obvious infinite loop... all of my toolchains (4.2, 4.5,
>>> 4.6, 4.8) are able to compile this without complaining (gcc -Wall):
>>>
>>> int test() { do { } while (1); }
>>
>> Not here. gcc 4.8 warns on that.
>> As soon I add __attribute__ ((noreturn)) it does not longer complain.
> 
> Huh? Maybe I have a crazy modified gcc.
> 
> $ gcc --version
> gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $ gcc -Wall -Wextra -c a.c
> $ cat a.c
> int test() { do {} while (1); }

Make test static and gcc will warn.

Thanks,
//richard

WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Ben Shelton <ben.shelton@ni.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Punnaiah Choudary Kalluri  <punnaiah.choudary.kalluri@xilinx.com>
Subject: Re: [PATCH 1/3] mtd: nand: Add on-die ECC support
Date: Tue, 28 Apr 2015 01:15:49 +0200	[thread overview]
Message-ID: <553EC325.6060401@nod.at> (raw)
In-Reply-To: <CAN8TOE8Wx_KKy_2Lu_8j8iUaL+Q+rff_mR=P8E8tFzuQaYcWPg@mail.gmail.com>

Am 28.04.2015 um 01:10 schrieb Brian Norris:
> On Mon, Apr 27, 2015 at 3:57 PM, Richard Weinberger <richard@nod.at> wrote:
>> Am 28.04.2015 um 00:53 schrieb Brian Norris:
>>> On Tue, Apr 28, 2015 at 12:42:18AM +0200, Richard Weinberger wrote:
>>>> Am 28.04.2015 um 00:36 schrieb Ben Shelton:
>>>>>>> When I build this without CONFIG_MTD_NAND_ECC_ON_DIE enabled, I get the
>>>>>>> following warning here:
>>>>>>>
>>>>>>> In file included from drivers/mtd/nand/nand_base.c:46:0:
>>>>>>> include/linux/mtd/nand_ondie.h: In function 'nand_read_subpage_on_die':
>>>>>>> include/linux/mtd/nand_ondie.h:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
>>>>>>> include/linux/mtd/nand_ondie.h: In function 'nand_read_page_on_die':
>>>>>>> include/linux/mtd/nand_ondie.h:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
>>>>>>>
>>>>>>> Perhaps return an error code here, even though you'll never get past the BUG()?
>>>>>>
>>>>>> What gcc is this?
>>>>>> gcc 4.8 here does not warn, I thought it is smart enough that this function does never
>>>>>> return. Can it be that your .config has CONFIG_BUG=n?
>>>>>> Anyway, this functions clearly needs a return statement. :)
>>>>>
>>>>> gcc 4.7.2, and you are correct that I had CONFIG_BUG off.  :)
>>>>
>>>> Yeah, just noticed that BUG() with CONFIG_BUG=n does not have
>>>> a nonreturn attribute. So, gcc cannot know...
>>>
>>> But it's an obvious infinite loop... all of my toolchains (4.2, 4.5,
>>> 4.6, 4.8) are able to compile this without complaining (gcc -Wall):
>>>
>>> int test() { do { } while (1); }
>>
>> Not here. gcc 4.8 warns on that.
>> As soon I add __attribute__ ((noreturn)) it does not longer complain.
> 
> Huh? Maybe I have a crazy modified gcc.
> 
> $ gcc --version
> gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $ gcc -Wall -Wextra -c a.c
> $ cat a.c
> int test() { do {} while (1); }

Make test static and gcc will warn.

Thanks,
//richard

  reply	other threads:[~2015-04-27 23:16 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 14:02 [RFC] On-die ECC support Richard Weinberger
2015-03-25 14:02 ` Richard Weinberger
2015-03-25 14:02 ` [PATCH 1/3] mtd: nand: Add on-die " Richard Weinberger
2015-03-25 14:02   ` Richard Weinberger
2015-03-25 20:39   ` Paul Bolle
2015-03-25 20:39     ` Paul Bolle
2015-04-27 21:35   ` Ben Shelton
2015-04-27 21:35     ` Ben Shelton
2015-04-27 22:19     ` Richard Weinberger
2015-04-27 22:19       ` Richard Weinberger
2015-04-27 22:36       ` Ben Shelton
2015-04-27 22:36         ` Ben Shelton
2015-04-27 22:42         ` Richard Weinberger
2015-04-27 22:42           ` Richard Weinberger
2015-04-27 22:53           ` Brian Norris
2015-04-27 22:53             ` Brian Norris
2015-04-27 22:57             ` Richard Weinberger
2015-04-27 22:57               ` Richard Weinberger
2015-04-27 23:10               ` Brian Norris
2015-04-27 23:10                 ` Brian Norris
2015-04-27 23:15                 ` Richard Weinberger [this message]
2015-04-27 23:15                   ` Richard Weinberger
2015-04-27 23:19                   ` Brian Norris
2015-04-27 23:19                     ` Brian Norris
2015-04-27 23:23       ` Brian Norris
2015-04-27 23:23         ` Brian Norris
2015-04-28  2:48         ` punnaiah choudary kalluri
2015-04-28  2:48           ` punnaiah choudary kalluri
2015-04-28  3:22           ` Brian Norris
2015-04-28  3:22             ` Brian Norris
2015-04-28  3:44             ` punnaiah choudary kalluri
2015-04-28  3:44               ` punnaiah choudary kalluri
2015-04-28 14:03               ` Josh Cartwright
2015-04-28 14:03                 ` Josh Cartwright
2015-04-28 16:19                 ` punnaiah choudary kalluri
2015-04-28 16:19                   ` punnaiah choudary kalluri
2015-05-08 21:26             ` Ben Shelton
2015-05-08 21:26               ` Ben Shelton
2015-05-08 21:39               ` Brian Norris
2015-05-08 21:39                 ` Brian Norris
2015-05-08 21:43                 ` Richard Weinberger
2015-05-08 21:43                   ` Richard Weinberger
2015-04-28  3:15   ` punnaiah choudary kalluri
2015-04-28  3:15     ` punnaiah choudary kalluri
2015-03-25 14:02 ` [PATCH 2/3] mtd: nand: Add support for raw access when using on-die ECC Richard Weinberger
2015-03-25 14:02   ` Richard Weinberger
2015-03-25 14:02 ` [PATCH 3/3] mtd: nand: Wire up on-die ECC support Richard Weinberger
2015-03-25 14:02   ` Richard Weinberger
2015-04-21 12:31 ` [RFC] On-die " Richard Weinberger
2015-04-21 12:31   ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553EC325.6060401@nod.at \
    --to=richard@nod.at \
    --cc=ben.shelton@ni.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=punnaiah.choudary.kalluri@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.