linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] scsi: myrb: replace !strcmp with sysfs_streq
@ 2022-10-08  8:49 yexingchen116
  0 siblings, 0 replies; only message in thread
From: yexingchen116 @ 2022-10-08  8:49 UTC (permalink / raw)
  To: martin.petersen; +Cc: hare, jejb, linux-scsi, 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/scsi/myrb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index e885c1dbf61f..7f269b90c9e4 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -1813,12 +1813,12 @@ static ssize_t raid_state_store(struct device *dev,
 	enum myrb_devstate new_state;
 	unsigned short status;
 
-	if (!strncmp(buf, "kill", 4) ||
-	    !strncmp(buf, "offline", 7))
+	if (sysfs_streq(buf, "kill") ||
+	    sysfs_streq(buf, "offline"))
 		new_state = MYRB_DEVICE_DEAD;
-	else if (!strncmp(buf, "online", 6))
+	else if (sysfs_streq(buf, "online"))
 		new_state = MYRB_DEVICE_ONLINE;
-	else if (!strncmp(buf, "standby", 7))
+	else if (sysfs_streq(buf, "standby"))
 		new_state = MYRB_DEVICE_STANDBY;
 	else
 		return -EINVAL;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-08  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08  8:49 [PATCH linux-next] scsi: myrb: replace !strcmp with sysfs_streq yexingchen116

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).