lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 15 Oct 2022 11:07:24 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     yexingchen116@...il.com
Cc:     richard@....at, vigneshr@...com, wsa+renesas@...g-engineering.com,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
        ye xingchen <ye.xingchen@....com.cn>
Subject: Re: [PATCH linux-next] mtd: replace strcmp with sysfs_streq

Hi yexingchen116@...il.com,

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

> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Replace the open-code with sysfs_streq().
> 
> Signed-off-by: ye xingchen <ye.xingchen@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ