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

greybus: svc: use string choice helpers instead of ternary operator

Replace ternary operator with str_enabled_disabled() helper to improve
code readability and consistency.

Generated using Coccinelle semantic patch.

Signed-off-by: Nai-Chen Cheng <bleach1827@gmail.com>
Reviewed-by: Alex Elder <elder@riscstar.com>
Link: https://lore.kernel.org/r/20250806-greybus-string-choices-v1-1-3e1c91048b62@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nai-Chen Cheng and committed by
Greg Kroah-Hartman
0e805e8b 51ad6d97

+2 -1
+2 -1
drivers/greybus/svc.c
··· 10 10 #include <linux/kstrtox.h> 11 11 #include <linux/workqueue.h> 12 12 #include <linux/greybus.h> 13 + #include <linux/string_choices.h> 13 14 14 15 #define SVC_INTF_EJECT_TIMEOUT 9000 15 16 #define SVC_INTF_ACTIVATE_TIMEOUT 6000 ··· 74 73 struct gb_svc *svc = to_gb_svc(dev); 75 74 76 75 return sprintf(buf, "%s\n", 77 - gb_svc_watchdog_enabled(svc) ? "enabled" : "disabled"); 76 + str_enabled_disabled(gb_svc_watchdog_enabled(svc))); 78 77 } 79 78 80 79 static ssize_t watchdog_store(struct device *dev,