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

usbnet: add usbnet_event_names[] for kevent

Modify the netdev_dbg content from int to char * in usbnet_defer_kevent(),
this looks more readable.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yajun Deng and committed by
David S. Miller
47889068 67faf76d

+19 -2
+19 -2
drivers/net/usb/usbnet.c
··· 74 74 75 75 /*-------------------------------------------------------------------------*/ 76 76 77 + static const char * const usbnet_event_names[] = { 78 + [EVENT_TX_HALT] = "EVENT_TX_HALT", 79 + [EVENT_RX_HALT] = "EVENT_RX_HALT", 80 + [EVENT_RX_MEMORY] = "EVENT_RX_MEMORY", 81 + [EVENT_STS_SPLIT] = "EVENT_STS_SPLIT", 82 + [EVENT_LINK_RESET] = "EVENT_LINK_RESET", 83 + [EVENT_RX_PAUSED] = "EVENT_RX_PAUSED", 84 + [EVENT_DEV_ASLEEP] = "EVENT_DEV_ASLEEP", 85 + [EVENT_DEV_OPEN] = "EVENT_DEV_OPEN", 86 + [EVENT_DEVICE_REPORT_IDLE] = "EVENT_DEVICE_REPORT_IDLE", 87 + [EVENT_NO_RUNTIME_PM] = "EVENT_NO_RUNTIME_PM", 88 + [EVENT_RX_KILL] = "EVENT_RX_KILL", 89 + [EVENT_LINK_CHANGE] = "EVENT_LINK_CHANGE", 90 + [EVENT_SET_RX_MODE] = "EVENT_SET_RX_MODE", 91 + [EVENT_NO_IP_ALIGN] = "EVENT_NO_IP_ALIGN", 92 + }; 93 + 77 94 /* handles CDC Ethernet and many other network "bulk data" interfaces */ 78 95 int usbnet_get_endpoints(struct usbnet *dev, struct usb_interface *intf) 79 96 { ··· 469 452 { 470 453 set_bit (work, &dev->flags); 471 454 if (!schedule_work (&dev->kevent)) 472 - netdev_dbg(dev->net, "kevent %d may have been dropped\n", work); 455 + netdev_dbg(dev->net, "kevent %s may have been dropped\n", usbnet_event_names[work]); 473 456 else 474 - netdev_dbg(dev->net, "kevent %d scheduled\n", work); 457 + netdev_dbg(dev->net, "kevent %s scheduled\n", usbnet_event_names[work]); 475 458 } 476 459 EXPORT_SYMBOL_GPL(usbnet_defer_kevent); 477 460