Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: hisi_hikey_usb: Use str_enabled_disabled() in hub_power_ctrl()

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>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20250813180108.209096-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
89fb7d73 82bfe768

+2 -1
+2 -1
drivers/misc/hisi_hikey_usb.c
··· 18 18 #include <linux/property.h> 19 19 #include <linux/regulator/consumer.h> 20 20 #include <linux/slab.h> 21 + #include <linux/string_choices.h> 21 22 #include <linux/usb/role.h> 22 23 23 24 #define DEVICE_DRIVER_NAME "hisi_hikey_usb" ··· 68 67 if (ret) 69 68 dev_err(hisi_hikey_usb->dev, 70 69 "Can't switch regulator state to %s\n", 71 - value ? "enabled" : "disabled"); 70 + str_enabled_disabled(value)); 72 71 } 73 72 74 73 static void usb_switch_ctrl(struct hisi_hikey_usb *hisi_hikey_usb,