From: Thorsten Blum <thorsten.blum@linux.dev>
To: John Stultz <jstultz@google.com>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] misc: hisi_hikey_usb: Use str_enabled_disabled() in hub_power_ctrl()
Date: Wed, 13 Aug 2025 20:01:08 +0200 [thread overview]
Message-ID: <20250813180108.209096-2-thorsten.blum@linux.dev> (raw)
Remove hard-coded strings by using the str_enabled_disabled() helper
function and silence the following Coccinelle/coccicheck warning
reported by string_choices.cocci:
opportunity for str_enabled_disabled(value)
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/misc/hisi_hikey_usb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/hisi_hikey_usb.c b/drivers/misc/hisi_hikey_usb.c
index ffe7b945a298..2c6e448a47f1 100644
--- a/drivers/misc/hisi_hikey_usb.c
+++ b/drivers/misc/hisi_hikey_usb.c
@@ -18,6 +18,7 @@
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include <linux/usb/role.h>
#define DEVICE_DRIVER_NAME "hisi_hikey_usb"
@@ -67,7 +68,7 @@ static void hub_power_ctrl(struct hisi_hikey_usb *hisi_hikey_usb, int value)
if (ret)
dev_err(hisi_hikey_usb->dev,
"Can't switch regulator state to %s\n",
- value ? "enabled" : "disabled");
+ str_enabled_disabled(value));
}
static void usb_switch_ctrl(struct hisi_hikey_usb *hisi_hikey_usb,
--
2.50.1
next reply other threads:[~2025-08-13 18:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 18:01 Thorsten Blum [this message]
2025-08-14 4:12 ` [PATCH] misc: hisi_hikey_usb: Use str_enabled_disabled() in hub_power_ctrl() John Stultz
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=20250813180108.209096-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.