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

net/core: tidy up an error message

netif_napi_add() could report an error like this below due to it allows
to pass a format string for wildcarding before calling
dev_get_valid_name(),

"netif_napi_add() called with weight 256 on device eth%d"

For example, hns_enet_drv module does this.

hns_nic_try_get_ae
hns_nic_init_ring_data
netif_napi_add
register_netdev
dev_get_valid_name

Hence, make it a bit more human-readable by using netdev_err_once()
instead.

Signed-off-by: Qian Cai <cai@gmx.us>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Qian Cai and committed by
David S. Miller
bf29e9e9 a7451560

+2 -2
+2 -2
net/core/dev.c
··· 6209 6209 napi->skb = NULL; 6210 6210 napi->poll = poll; 6211 6211 if (weight > NAPI_POLL_WEIGHT) 6212 - pr_err_once("netif_napi_add() called with weight %d on device %s\n", 6213 - weight, dev->name); 6212 + netdev_err_once(dev, "%s() called with weight %d\n", __func__, 6213 + weight); 6214 6214 napi->weight = weight; 6215 6215 list_add(&napi->dev_list, &dev->napi_list); 6216 6216 napi->dev = dev;