From: Joe Perches <joe@perches.com>
To: Qian Cai <cai@gmx.us>, davem@davemloft.net
Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/core: tidy up an error message
Date: Sat, 01 Dec 2018 06:43:40 -0800 [thread overview]
Message-ID: <fc4e1657b33a532b2e970e4b319d0ab5375a1355.camel@perches.com> (raw)
In-Reply-To: <20181201045153.4035-1-cai@gmx.us>
On Fri, 2018-11-30 at 23:51 -0500, Qian Cai wrote:
> 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.
[]
> diff --git a/net/core/dev.c b/net/core/dev.c
[]
> @@ -6205,7 +6205,8 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
> napi->poll = poll;
> if (weight > NAPI_POLL_WEIGHT)
> pr_err_once("netif_napi_add() called with weight %d on device %s\n",
> - weight, dev->name);
> + weight,
> + !strchr(dev->name, '%') ? dev->name : "unknown");
perhaps instead use netdev_err_once
next prev parent reply other threads:[~2018-12-01 14:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 4:51 [PATCH] net/core: tidy up an error message Qian Cai
2018-12-01 14:43 ` Joe Perches [this message]
2018-12-01 17:17 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc4e1657b33a532b2e970e4b319d0ab5375a1355.camel@perches.com \
--to=joe@perches.com \
--cc=cai@gmx.us \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox