linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yexingchen116@gmail.com
To: martin.petersen@oracle.com
Cc: hare@kernel.org, jejb@linux.ibm.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	ye xingchen <ye.xingchen@zte.com.cn>
Subject: [PATCH linux-next] scsi: myrb: replace !strcmp with sysfs_streq
Date: Sat,  8 Oct 2022 08:49:07 +0000	[thread overview]
Message-ID: <20221008084907.309320-1-ye.xingchen@zte.com.cn> (raw)

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


                 reply	other threads:[~2022-10-08  8:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221008084907.309320-1-ye.xingchen@zte.com.cn \
    --to=yexingchen116@gmail.com \
    --cc=hare@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ye.xingchen@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).