All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>
Cc: "boris.brezillon@bootlin.com" <boris.brezillon@bootlin.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
	"frieder.schrempf@exceet.de" <frieder.schrempf@exceet.de>,
	"cyrille.pitchen@wedev4u.fr" <cyrille.pitchen@wedev4u.fr>,
	"computersforpeace@gmail.com" <computersforpeace@gmail.com>
Subject: Re: [RESEND PATCH 1/2] mtd: spi-nor: add macros related to MICRON flash
Date: Thu, 20 Sep 2018 12:20:15 +0300	[thread overview]
Message-ID: <2f7430c2-bef0-0959-e428-ea1658cb9818@microchip.com> (raw)
In-Reply-To: <VI1PR04MB103873DF92DF3380E53C572699130@VI1PR04MB1038.eurprd04.prod.outlook.com>


>>> diff --git a/drivers/mtd/spi-nor/spi-nor.c
>>> @@ -271,6 +271,7 @@ static inline int set_4byte(struct spi_nor *nor, const
>> struct flash_info *info,
>>>  	u8 cmd;
>>>
>>>  	switch (JEDEC_MFR(info)) {
>>> +	case SNOR_MFR_ST:
>>
>> We should mark switch cases where we are expecting to fall through, so that we
>> will be prepared when enabling -Wimplicit-fallthrough.
> 
> Please explain more, not able to get this comment. Sorry for ignorance.
> 
>>
>>>  	case SNOR_MFR_MICRON:
>>>  		/* Some Micron need WREN command; all will accept it */
>>>  		need_wren = true;

We can ignore my comment, it's not in the scope of this patch.

I wrongly suggested to do this:
case SNOR_MFR_ST:
	/* fall through */
case SNOR_MFR_MICRON:

in order to suppress the -Wimplicit-fallthrough warning that I thought it will
appear on gcc 7. The suggestion is wrong because the warning is not emitted for
empty case bodies, so it's not needed here.

However, when compiling with gcc 7 and -Wimplicit-fallthrough the following can
be seen:

drivers/mtd/spi-nor/spi-nor.c: In function ‘set_4byte’:
drivers/mtd/spi-nor/spi-nor.c:290:13: warning: this statement may fall through
[-Wimplicit-fallthrough=]
   need_wren = true;
   ~~~~~~~~~~^~~~~~
drivers/mtd/spi-nor/spi-nor.c:291:2: note: here
  case SNOR_MFR_MACRONIX:
  ^~~~

We should add a /* fall through */ comment after setting need_wren = true;, but
it's not in the scope of this patch.

Cheers,
ta

  reply	other threads:[~2018-09-20  9:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  4:50 [RESEND PATCH 0/2] mtd: spi-nor: add entry for mt35xu512aba flash Yogesh Gaur
2018-09-19  4:50 ` [RESEND PATCH 1/2] mtd: spi-nor: add macros related to MICRON flash Yogesh Gaur
2018-09-19 16:30   ` Tudor Ambarus
2018-09-20  4:31     ` Yogesh Narayan Gaur
2018-09-20  9:20       ` Tudor Ambarus [this message]
2018-10-05  4:30       ` Yogesh Narayan Gaur
2018-10-05  4:30         ` Yogesh Narayan Gaur
2018-10-09  4:01   ` Tudor Ambarus
2018-09-19  4:50 ` [RESEND PATCH 2/2] mtd: spi-nor: add entry for mt35xu512aba flash Yogesh Gaur
2018-09-19 16:23   ` Tudor Ambarus
  -- strict thread matches above, loose matches on Subject: below --
2018-09-19  4:48 [RESEND PATCH 0/2] " Yogesh Gaur
2018-09-19  4:48 ` [RESEND PATCH 1/2] mtd: spi-nor: add macros related to MICRON flash Yogesh Gaur

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=2f7430c2-bef0-0959-e428-ea1658cb9818@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=frieder.schrempf@exceet.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=yogeshnarayan.gaur@nxp.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.