linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: yexingchen116@gmail.com
Cc: richard@nod.at, vigneshr@ti.com,
	wsa+renesas@sang-engineering.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	ye xingchen <ye.xingchen@zte.com.cn>
Subject: Re: [PATCH linux-next] mtd: replace strcmp with sysfs_streq
Date: Sat, 15 Oct 2022 11:07:24 +0200	[thread overview]
Message-ID: <20221015110724.5c535807@xps-13> (raw)
In-Reply-To: <20221008074643.308969-1-ye.xingchen@zte.com.cn>

Hi yexingchen116@gmail.com,

yexingchen116@gmail.com wrote on Sat,  8 Oct 2022 07:46:43 +0000:

> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with sysfs_streq().
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/mtd/parsers/cmdlinepart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/parsers/cmdlinepart.c
> b/drivers/mtd/parsers/cmdlinepart.c
> index b34856def816..6a401e0b1b95 100644
> --- a/drivers/mtd/parsers/cmdlinepart.c
> +++ b/drivers/mtd/parsers/cmdlinepart.c
> @@ -154,7 +154,7 @@ static struct mtd_partition * newpart(char *s,
>  	}
>  
>  	/* if slc is found use emulated SLC mode on this partition*/
> -	if (!strncmp(s, "slc", 3)) {
> +	if (sysfs_streq(s, "slc")) {

I'm sorry but, why this would be a use for sysfs_streq? The point of
this helper is to consider "\n" null, which is not relevant here. Or do
I miss something?

>  		add_flags |= MTD_SLC_ON_MLC_EMULATION;
>  		s += 3;
>  	}


Thanks,
Miquèl

      reply	other threads:[~2022-10-15  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  7:46 [PATCH linux-next] mtd: replace strcmp with sysfs_streq yexingchen116
2022-10-15  9:07 ` Miquel Raynal [this message]

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=20221015110724.5c535807@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=ye.xingchen@zte.com.cn \
    --cc=yexingchen116@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).