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.

thunderbolt: Use string choices helpers

Use string_choices.h helpers instead of hard-coded strings.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

authored by

Chelsy Ratnawat and committed by
Mika Westerberg
b0657849 5d038471

+11 -8
+2 -1
drivers/thunderbolt/debugfs.c
··· 12 12 #include <linux/debugfs.h> 13 13 #include <linux/delay.h> 14 14 #include <linux/pm_runtime.h> 15 + #include <linux/string_choices.h> 15 16 #include <linux/uaccess.h> 16 17 17 18 #include "tb.h" ··· 692 691 seq_printf(s, "0x%08x\n", margining->caps[i]); 693 692 694 693 seq_printf(s, "# software margining: %s\n", 695 - supports_software(margining) ? "yes" : "no"); 694 + str_yes_no(supports_software(margining))); 696 695 if (supports_hardware(margining)) { 697 696 seq_puts(s, "# hardware margining: yes\n"); 698 697 seq_puts(s, "# minimum BER level contour: ");
+2 -1
drivers/thunderbolt/nhi.c
··· 19 19 #include <linux/module.h> 20 20 #include <linux/delay.h> 21 21 #include <linux/property.h> 22 + #include <linux/string_choices.h> 22 23 #include <linux/string_helpers.h> 23 24 24 25 #include "nhi.h" ··· 147 146 dev_WARN(&ring->nhi->pdev->dev, 148 147 "interrupt for %s %d is already %s\n", 149 148 RING_TYPE(ring), ring->hop, 150 - active ? "enabled" : "disabled"); 149 + str_enabled_disabled(active)); 151 150 152 151 if (active) 153 152 iowrite32(new, ring->nhi->iobase + reg);
+7 -6
drivers/thunderbolt/usb4.c
··· 9 9 10 10 #include <linux/delay.h> 11 11 #include <linux/ktime.h> 12 + #include <linux/string_choices.h> 12 13 #include <linux/units.h> 13 14 14 15 #include "sb_regs.h" ··· 173 172 return; 174 173 175 174 tb_sw_dbg(sw, "PCIe wake: %s, USB3 wake: %s\n", 176 - (val & ROUTER_CS_6_WOPS) ? "yes" : "no", 177 - (val & ROUTER_CS_6_WOUS) ? "yes" : "no"); 175 + str_yes_no(val & ROUTER_CS_6_WOPS), 176 + str_yes_no(val & ROUTER_CS_6_WOUS)); 178 177 179 178 wakeup = val & (ROUTER_CS_6_WOPS | ROUTER_CS_6_WOUS); 180 179 } ··· 192 191 break; 193 192 194 193 tb_port_dbg(port, "USB4 wake: %s, connection wake: %s, disconnection wake: %s\n", 195 - (val & PORT_CS_18_WOU4S) ? "yes" : "no", 196 - (val & PORT_CS_18_WOCS) ? "yes" : "no", 197 - (val & PORT_CS_18_WODS) ? "yes" : "no"); 194 + str_yes_no(val & PORT_CS_18_WOU4S), 195 + str_yes_no(val & PORT_CS_18_WOCS), 196 + str_yes_no(val & PORT_CS_18_WODS)); 198 197 199 198 wakeup_usb4 = val & (PORT_CS_18_WOU4S | PORT_CS_18_WOCS | 200 199 PORT_CS_18_WODS); ··· 261 260 tbt3 = !(val & ROUTER_CS_6_TNS); 262 261 263 262 tb_sw_dbg(sw, "TBT3 support: %s, xHCI: %s\n", 264 - tbt3 ? "yes" : "no", xhci ? "yes" : "no"); 263 + str_yes_no(tbt3), str_yes_no(xhci)); 265 264 266 265 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, ROUTER_CS_5, 1); 267 266 if (ret)