Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1876083imm; Fri, 7 Sep 2018 07:30:10 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbld57TOgE0H96CG7HecATOOQFMSPzo/LVzXCV0Mt5mJxDD94Z8K/H9PFR0NglMexVS6HFx X-Received: by 2002:a65:4289:: with SMTP id j9-v6mr8563893pgp.284.1536330610787; Fri, 07 Sep 2018 07:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536330610; cv=none; d=google.com; s=arc-20160816; b=lJNOdEqtbEKwjggmtyYscNBQkx29+Y7F3+/k9D7fpW0W2mXOY2ZbibpJHFKClEj3nf +HqAFe3SMaJLNLzXvwDVU2dXy5tl35kjYsbbeOAHpCitZd+N7zPrLQi9rEIpBuFZ1k6T PM5SbW9bC+W0x9+8zC3KLEL9XOxOWa/nZafHzuo6xCnqtyGZnBkl3Vjye+TsCkkA2SsA y45M88MW/iplDdpuFTz4LR/a8tXT1cMtfPW5iDDS0NzMKIKk6nFHCAX2C8bVPIKPr0fq xS3z4qqBL9alHZDVZd7p4AIJWLGIQT9NKjoEaS10441/wwSomVgwAiZ9m0NlYtdjNi/C bNug== 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=Cfuee3E071VZB2RjsFfjUfyIDBDiFjRMJRu4qQ8RzoA=; b=J+OGQxpOwzA76VHc0WjbdyMocbENa2558XiMrtAaofDatRIui3WNKlCQh9T9xH2UNR 4V4DnPfq3lHzzUtvT901pZAzXT7WUPfRkTGKOkqDGu2Aq/ozRWSQ3+B2b8Wp8vLPF3CY l2v/h65iq27DAYy7ysb2OKy/k1+0LFZe+LEqmQnrMbYliJQsUdVpY59sQXf6QGGwcWWP 68OVd4BvtyuKXoyWAWn0YYpX+zcCLt7WQDyie2h39PvPmqK2TkqSl8UviCPPyR83PD7b L0sonKgZp3YpWSbCDB+Hs8/AZbzI1vM5pVj4cSes0+kDKYUM0a2PxHHvhaPOQP19plXT BQvA== 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 p64-v6si8312499pga.25.2018.09.07.07.29.52; Fri, 07 Sep 2018 07:30:10 -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 S1728891AbeIGQAW (ORCPT + 99 others); Fri, 7 Sep 2018 12:00:22 -0400 Received: from mx01.hxt-semitech.com ([223.203.96.7]:46816 "EHLO barracuda.hxt-semitech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728876AbeIGQAV (ORCPT ); Fri, 7 Sep 2018 12:00:21 -0400 X-ASG-Debug-ID: 1536319181-093b7e54e60b370003-xx1T2L Received: from HXTBJIDCEMVIW02.hxtcorp.net ([10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id ARGbx1YfwZn4Na5M (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 07 Sep 2018 19:19:45 +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 2/2] net: ethernet: i40evf: fix underlying build error Date: Fri, 7 Sep 2018 19:19:35 +0800 X-ASG-Orig-Subj: [PATCH v3 2/2] net: ethernet: i40evf: fix underlying build error Message-ID: <1536319175-3660-3-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: 1536319183 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.8813 1.0000 3.0288 X-Barracuda-Spam-Score: 3.03 X-Barracuda-Spam-Status: No, SCORE=3.03 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.57058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Can't have non-inline function in a header file. There is a risk of "Multiple definition" from cross-including. 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 --- .../intel/i40evf/i40e_ethtool_stats.h | 23 +----------------- .../ethernet/intel/i40evf/i40evf_ethtool.c | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h b/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h index 60b595dd8c39..62ab67a77753 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_ethtool_stats.h @@ -181,29 +181,8 @@ i40evf_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 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); - } -} + const unsigned int size, ...); /** * 40e_add_stat_strings - copy stat strings into ethtool buffer diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index 9319971c5c92..eb2e910bc3a1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c @@ -171,6 +171,30 @@ static void i40evf_get_priv_flag_strings(struct net_device *netdev, u8 *data) } } +/** + * __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); + } +} + /** * i40evf_get_stat_strings - Get stat strings * @netdev: network interface device structure -- 2.18.0