r8169: use str_enabled_disabled() helper
PATCH 1/1 r8169: use str_enabled_disabled() helper
Replace the open-coded ternary condition (? "enabled" : "disabled") with the str_enabled_disabled() helper from <linux/string_choices.h> to improve code readability and maintain uniform string representation.
Signed-off-by Gabriel Windlin <[email protected]>
--- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169_main.c +2 -1
@@ -30,6 +30,7 @@#include <linux/prefetch.h> #include <linux/ipv6.h> #include <linux/unaligned.h> +#include <linux/string_choices.h> #include <net/ip6_checksum.h> #include <net/netdev_queues.h>
@@ -6225,7 +6226,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (tp->dash_type !=RTL_DASH_NONE ) {netdev_info (dev,"DASH %s\n" , - tp->dash_enabled ?"enabled" :"disabled" ); +str_enabled_disabled (tp->dash_enabled));rtl8168_driver_start (tp); }
base-commit: ab217fbb9b2169ce677b09a66558d5c3adcfbb76
Signature · 1 line
2.55.0
Jakub Kicinski
maintainerQuoted 3 lines · On Tue, 8 Sep 2026 22:03:08 +0200 Gabriel Windlin wrote:
Replace the open-coded ternary condition (? "enabled" : "disabled") with the
str_enabled_disabled()helper from <linux/string_choices.h> to improve code readability and maintain uniform string representation.
It does not improve readability. Please don't send these sort of patches to networking.