Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1757646imm; Fri, 7 Sep 2018 05:48:41 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdavqba9Sl8X8cjLGVLf+c+QQ5fz9+HtmNMEK/EULNz98WOA3Cfecqe7huhjvYX2bhnlDr+U X-Received: by 2002:a62:d94:: with SMTP id 20-v6mr8267103pfn.202.1536324521820; Fri, 07 Sep 2018 05:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536324521; cv=none; d=google.com; s=arc-20160816; b=pa55QOR2IzuX/45FPTtxNybNk1djHOnVEMLbzKj0S5hco8mLtB0OQ4v2H6YSa4b+vR HPVY2BL3ba/VeomQvFjR6nf+RXQxHmbIgF0Ms37+f89PeaLZwDA8XDFt2oukufh1Ud5g DIB0xEciG0whEjVXxASNPqRPoawUQfDIhnG+lDv7yUa9+SMIOnyy8G1mqfBmJZdtzcb0 GY0YfPAiEIbRDvcM68fqjcr3ROJyD7q5sXXMg938vNXOPGbk0qJxPgG8nr+fyYi/NR27 suN9pX02y7x7ZPxMtpAGWzCa2cInaPEFPISGiJE2D6XT//aGR5xZeOLRxcqohzYXjM5F V7Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=aPWD3VwCzCt4MG3JTQhKi5WuFIrIpJF2ZsDoPg4taKE=; b=Zif04DkiJ8kgUwBvURpMvJ5i6cMWC+k7/8adgL8TYWs1UWDhh9kVRgCtrL03/y8Kd9 wb4MlTf3kfZ/b3vSZsEI5Rczt7rA8nfWAbrqUjT2etDw09uTvhSBQZrM+W96w8F6sy+Z kC6/Kveh7c2fTkoJW8djHv/crTjzfSDXA0q5UHwblHqKQy8z9aDtpTZIlAYHm/ySymv0 aM4o7nkZQ6gUj0cIzDtltF7uF9vNxVK1uXGtAU0LM0ln/asAipG2tPpPWwECeKiAYANt CM1jkfUKk7UfPfPxblSYe52BhqifVxtXMx8gsahKmCtT6woSzJ2CGE4rY98N1UJ7FuH7 uR8w== 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 8-v6si7946723pgu.519.2018.09.07.05.48.25; Fri, 07 Sep 2018 05:48:41 -0700 (PDT) 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 S1728906AbeIGQAa (ORCPT + 99 others); Fri, 7 Sep 2018 12:00:30 -0400 Received: from mx01.hxt-semitech.com ([223.203.96.7]:46793 "EHLO barracuda.hxt-semitech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728868AbeIGQAW (ORCPT ); Fri, 7 Sep 2018 12:00:22 -0400 X-ASG-Debug-ID: 1536319181-093b7e54e60b370002-xx1T2L Received: from HXTBJIDCEMVIW02.hxtcorp.net ([10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id X8AS2Yr9EyYdXZ4z (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 07 Sep 2018 19:19:43 +0800 (CST) X-Barracuda-Envelope-From: dongsheng.wang@hxt-semitech.com Received: from localhost.localdomain.localdomain (10.5.21.103) by HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 7 Sep 2018 19:19:45 +0800 From: Wang Dongsheng To: , CC: , , , , , Wang Dongsheng Subject: [PATCH v3 1/2] net: ethernet: i40e: fix build error Date: Fri, 7 Sep 2018 19:19:34 +0800 X-ASG-Orig-Subj: [PATCH v3 1/2] net: ethernet: i40e: fix build error Message-ID: <1536319175-3660-2-git-send-email-dongsheng.wang@hxt-semitech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> References: <1536319175-3660-1-git-send-email-dongsheng.wang@hxt-semitech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.5.21.103] X-ClientProxiedBy: HXTBJIDCEMVIW01.hxtcorp.net (10.128.0.14) To HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) X-Barracuda-Connect: UNKNOWN[10.128.0.15] X-Barracuda-Start-Time: 1536319181 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA384 X-Barracuda-URL: https://192.168.50.101:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at hxt-semitech.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.8718 1.0000 2.9301 X-Barracuda-Spam-Score: 3.43 X-Barracuda-Spam-Status: No, SCORE=3.43 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.57058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove "inline" from __i40e_add_stat_strings and move the function. In file included from drivers/net/ethernet/intel/i40e/i40e_ethtool.c:9:0: drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function __i40e_add_stat_string: drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h:193:20: error: function __i40e_add_stat_strings can never be inlined because it uses variable argument lists static inline void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], Tested on: x86_64, make ARCH=i386 Modules section .text: i40e: 00019380 <__i40e_add_stat_strings>: i40evf: 00006b00 <__i40e_add_stat_strings>: Buildin section .text: i40e: c351ca60 <__i40e_add_stat_strings>: i40evf: c354f2c0 <__i40e_add_stat_strings>: Signed-off-by: Wang Dongsheng --- V3: add static V2: Move function --- .../net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++++++++++++ .../ethernet/intel/i40e/i40e_ethtool_stats.h | 25 ++----------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index d7d3974beca2..34121a72f2e7 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -1821,6 +1821,30 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, "ethtool stats count mismatch!"); } +/** + * __i40e_add_stat_strings - copy stat strings into ethtool buffer + * @p: ethtool supplied buffer + * @stats: stat definitions array + * @size: size of the stats array + * + * Format and copy the strings described by stats into the buffer pointed at + * by p. + **/ +static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], + const unsigned int size, ...) +{ + unsigned int i; + + for (i = 0; i < size; i++) { + va_list args; + + va_start(args, size); + vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); + *p += ETH_GSTRING_LEN; + va_end(args); + } +} + /** * i40e_get_stat_strings - copy stat strings into supplied buffer * @netdev: the netdev to collect strings for diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h b/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h index bba1cb0b658f..553b0d720839 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool_stats.h @@ -181,29 +181,8 @@ i40e_add_queue_stats(u64 **data, struct i40e_ring *ring) *data += size; } -/** - * __i40e_add_stat_strings - copy stat strings into ethtool buffer - * @p: ethtool supplied buffer - * @stats: stat definitions array - * @size: size of the stats array - * - * Format and copy the strings described by stats into the buffer pointed at - * by p. - **/ -static inline void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], - const unsigned int size, ...) -{ - unsigned int i; - - for (i = 0; i < size; i++) { - va_list args; - - va_start(args, size); - vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args); - *p += ETH_GSTRING_LEN; - va_end(args); - } -} +static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], + const unsigned int size, ...); /** * 40e_add_stat_strings - copy stat strings into ethtool buffer -- 2.18.0