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: <202211291504123795374@zte.com.cn>
Date:   Tue, 29 Nov 2022 15:04:12 +0800 (CST)
From:   <yang.yang29@....com.cn>
To:     <axboe@...nel.dk>
Cc:     <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <xu.panda@....com.cn>, <yang.yang29@....com.cn>
Subject: [PATCH linux-next] elevator: use sysfs_streq() instead of strncmp()

From: Xu Panda <xu.panda@....com.cn>

Replace the open-code with sysfs_streq().

Signed-off-by: Xu Panda <xu.panda@....com.cn>
Signed-off-by: Yang Yang <yang.yang29@....com>
---
 block/elevator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/elevator.c b/block/elevator.c
index 599413620558..6ed6049a01fd 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -721,7 +721,7 @@ static int elevator_change(struct request_queue *q, const char *elevator_name)
 	if (!blk_queue_registered(q))
 		return -ENOENT;

-	if (!strncmp(elevator_name, "none", 4)) {
+	if (sysfs_streq(elevator_name, "none")) {
 		if (q->elevator)
 			elevator_disable(q);
 		return 0;
-- 
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ