Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5470263imu; Sat, 1 Dec 2018 18:12:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/U7xjVS2PT3xiQQl5ttroJQLc4I2W/SdaFcpTWo1vmeXgSCbXTaJB1zGCfoCiMlcFg/RNUZ X-Received: by 2002:a17:902:be0c:: with SMTP id r12mr10710475pls.299.1543716761872; Sat, 01 Dec 2018 18:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543716761; cv=none; d=google.com; s=arc-20160816; b=eg0gcyDXxgd+VW+oUkHqjaL4Soiy7wdQ3bHTFFw8OeYZaPxegZJGe+hHTfgGJoaNKd BcV0Z2aj/0Rx2JaNlFjktaIZmy4FiGPwvr0qIoO36fBWd4W8VS9qIuBv1pIkYBBCpoWp 2mlvwjcnU+gsH1mWxhX8Ni8MvS2o+1GBLeU8f3eSxx3mrTzSEHvwTkNlZzlo7j/2yN4X QoeoFKolsstfLAbUANgX4Fjvqrr6W42eAmHyaDvQko818BQJiehsntGsMD4fUkZkNTox hjnvenFEQuBJICByAl45goZBGkUAuAFb2I+09rzZXTeXt74xZuhzoxshZwdoNRIgYOM+ sK2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=APmV+9aytKnWW2FZ3zih7rXVvKIusO65Z+M+iUS8Nm4=; b=poiUutMnK199sdo4G8JftMTX9M5S9SVzxTSe5jBMT2hRCpjuJo8IN25izT2r5GZ4P+ GfNkK9DNSYSCD1+YmJAH7mYiZR/Z6j9yu6ut/poOOAazDwHcJNkCCNMpeNZHBhBgwZv+ /B3xPZ2Qm/A8Y30pQPM70xKNdzCsU/jwxPuRaMpLE6UOpkzDMRf2veB8PC2KQ05llu4v 7ePhTcQb3tk/we/KF/ijr3uEVv6nhQyR2cxMHUIBjB2pPg/W0TFTMRrNzfXr5R7/aM0h NBqb23d510xmpes6ntxUZ0zowW0uw8rIpsc0ImfwxcwFB/oQ9b1NVUVJItwzZvoPIEyk qZdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si10650096pfm.85.2018.12.01.18.12.25; Sat, 01 Dec 2018 18:12:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725743AbeLBNZn (ORCPT + 99 others); Sun, 2 Dec 2018 08:25:43 -0500 Received: from mout.gmx.net ([212.227.17.21]:45117 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725727AbeLBNZn (ORCPT ); Sun, 2 Dec 2018 08:25:43 -0500 Received: from ovpn-120-135.rdu2.redhat.com ([98.118.28.103]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MFPyK-1ghWJa3Kzs-00EOvs; Sun, 02 Dec 2018 03:11:31 +0100 From: Qian Cai To: davem@davemloft.net Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, joe@perches.com, stephen@networkplumber.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH v2] net/core: tidy up an error message Date: Sat, 1 Dec 2018 21:11:19 -0500 Message-Id: <20181202021119.7737-1-cai@gmx.us> X-Mailer: git-send-email 2.17.2 (Apple Git-113) X-Provags-ID: V03:K1:iDx2G0xsSKwpkiPl7r+C81ag5RaddUSy9sxdYFGeAAq3x27X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1nm3T29Hw+Kv1NMEOnVrWgYxlLvCg+Nz52vHTIKcNNIc4Ax7 Waw+SI5fo4Ic8yqdgRIoXBgOlY8wB73S2QPQ8tcYw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v2: * Used netdev_err_once() suggested by Joe. * Replaced the hard-coded function name with __func__. net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index ddc551f24ba2..65ac80970d1f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6204,8 +6204,8 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi, napi->skb = NULL; 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); + netdev_err_once(dev, "%s() called with weight %d\n", __func__, + weight); napi->weight = weight; list_add(&napi->dev_list, &dev->napi_list); napi->dev = dev; -- 2.17.2 (Apple Git-113)