[PATCH linux-next] scsi: myrb: replace !strcmp with sysfs_streq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: ye xingchen <ye.xingchen@xxxxxxxxxx>

Replace the open-code with sysfs_streq().

Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
 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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux