Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3268631imm; Tue, 4 Sep 2018 19:28:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9vpjsBlFW2Fdnu8VuHveXDfgQlORCQY60GvPu6o9LtgtTf5EWlABRnn2iy8dQE0SbTxGr X-Received: by 2002:a17:902:4906:: with SMTP id u6-v6mr35951060pld.44.1536114532861; Tue, 04 Sep 2018 19:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536114532; cv=none; d=google.com; s=arc-20160816; b=pTqV0S/B20YqzbAGdwoPi15IK0+rbD8ffEsyKRcwgD05Yf/GjmfqhPJDd2cDHiP3E6 /XhBdhuXP5ZI8yrMTYDF49qlqm3/ZN5T9ILcT+yg7rLpn703tWuz3kiGPFwt7MvtsSil Yqsr5batZ9APJQLNdcm2ePNWC6sepWxGz+onSMWqWff6G0icpxhfXRk/oNUP+lyM9Dsc qsCOsAGn1TNI21gtOU1Nz05pEGC2zq09VWSBNYYOcfTAd+6NPBE1HNFZvEosMqJFa+UY RSNENy1Fv1dz3I2ht2gxSso5MY/fpMJ2VdBg6DWJh2ztvvjp2/si16oFMliNYwuVDyQ9 cEQQ== 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=XuJJkuhM+qmb7mkWc5MNKFzDfUNoRpWcNslFpu37/m8=; b=qb5yVX7q12hBmAhHCew/JY/hQPgPb+N48Ad9adweynejrhThhPvxw6pjl+MpLX5o74 w7mfWy6CVOsC3PAdo4Aip7hH+zchtVD8IaTWAv44J86rhqwsbEdZnucCb6oXSpIR8Ped rMHD4bvPqpE4//UsEPAjv8+iJpP3PQ+Dd4En+m+MZ7KL1Pa/l2SJtfiOqvPJYbcQlVXb 1kYpwhwDXb3bpVkn9knAUyWz6CFwv3dTFBZGB91TPDc6YpClipdDmMFR/iHPf6EPUebv Hhk+SGRP4g9mvVCEv35qKENhEUkfZN+ntGaCCwtOx5BUeTkk3C66IAh9gbqQIY/wjGQv Q2Tw== 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 m33-v6si581854pgb.450.2018.09.04.19.28.37; Tue, 04 Sep 2018 19:28:52 -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 S1726749AbeIEGzZ (ORCPT + 99 others); Wed, 5 Sep 2018 02:55:25 -0400 Received: from mx01.hxt-semitech.com ([223.203.96.7]:51343 "EHLO barracuda.hxt-semitech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726054AbeIEGzY (ORCPT ); Wed, 5 Sep 2018 02:55:24 -0400 X-ASG-Debug-ID: 1536114439-093b7e636b125ed0002-xx1T2L Received: from HXTBJIDCEMVIW02.hxtcorp.net ([10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id nBve9uldMcqvkAAb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 05 Sep 2018 10:27:21 +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; Wed, 5 Sep 2018 10:27:25 +0800 From: Wang Dongsheng To: , CC: , , , , , Wang Dongsheng Subject: [PATCH v2 2/2] net: ethernet: i40evf: fix potential build error Date: Wed, 5 Sep 2018 10:27:10 +0800 X-ASG-Orig-Subj: [PATCH v2 2/2] net: ethernet: i40evf: fix potential build error Message-ID: <1536114430-21356-2-git-send-email-dongsheng.wang@hxt-semitech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1536114430-21356-1-git-send-email-dongsheng.wang@hxt-semitech.com> References: <1536114430-21356-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: HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) To HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) X-Barracuda-Connect: UNKNOWN[10.128.0.15] X-Barracuda-Start-Time: 1536114440 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.8162 1.0000 2.3757 X-Barracuda-Spam-Score: 2.38 X-Barracuda-Spam-Status: No, SCORE=2.38 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.56898 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. Signed-off-by: Wang Dongsheng --- .../intel/i40evf/i40e_ethtool_stats.h | 25 ++----------------- .../ethernet/intel/i40evf/i40evf_ethtool.c | 24 ++++++++++++++++++ 2 files changed, 26 insertions(+), 23 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..d70a071f065f 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); - } -} +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 diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index 9319971c5c92..c9a54f6de61e 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. + **/ +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