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>] [day] [month] [year] [list]
Message-Id: <20221008065934.308408-1-ye.xingchen@zte.com.cn>
Date:   Sat,  8 Oct 2022 06:59:34 +0000
From:   yexingchen116@...il.com
To:     pavel@....cz
Cc:     linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        ye xingchen <ye.xingchen@....com.cn>
Subject: [PATCH linux-next] leds: leds-bd2802: replace strcmp with sysfs_streq

From: ye xingchen <ye.xingchen@....com.cn>

Replace the open-code with sysfs_streq().

Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
 drivers/leds/leds-bd2802.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 2b6678f6bd56..cbbda0cccf46 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -451,9 +451,9 @@ static ssize_t bd2802_store_adv_conf(struct device *dev,
 		return -EINVAL;
 
 	down_write(&led->rwsem);
-	if (!led->adf_on && !strncmp(buf, "on", 2))
+	if (!led->adf_on && sysfs_streq(buf, "on"))
 		bd2802_enable_adv_conf(led);
-	else if (led->adf_on && !strncmp(buf, "off", 3))
+	else if (led->adf_on && sysfs_streq(buf, "off"))
 		bd2802_disable_adv_conf(led);
 	up_write(&led->rwsem);
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ