* [PATCH linux-next] mtd: replace strcmp with sysfs_streq
@ 2022-10-08 7:46 yexingchen116
2022-10-15 9:07 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: yexingchen116 @ 2022-10-08 7:46 UTC (permalink / raw)
To: miquel.raynal
Cc: richard, vigneshr, wsa+renesas, linux-mtd, linux-kernel, ye xingchen
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")) {
add_flags |= MTD_SLC_ON_MLC_EMULATION;
s += 3;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] mtd: replace strcmp with sysfs_streq
2022-10-08 7:46 [PATCH linux-next] mtd: replace strcmp with sysfs_streq yexingchen116
@ 2022-10-15 9:07 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2022-10-15 9:07 UTC (permalink / raw)
To: yexingchen116
Cc: richard, vigneshr, wsa+renesas, linux-mtd, linux-kernel, ye xingchen
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-15 9:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 7:46 [PATCH linux-next] mtd: replace strcmp with sysfs_streq yexingchen116
2022-10-15 9:07 ` Miquel Raynal
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).