From: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
To: <jeffrey.t.kirsher@intel.com>, <sergei.shtylyov@cogentembedded.com>
Cc: <jacob.e.keller@intel.com>, <davem@davemloft.net>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
Subject: [PATCH v2 2/2] net: ethernet: i40evf: fix potential build error
Date: Wed, 5 Sep 2018 10:27:10 +0800 [thread overview]
Message-ID: <1536114430-21356-2-git-send-email-dongsheng.wang@hxt-semitech.com> (raw)
In-Reply-To: <1536114430-21356-1-git-send-email-dongsheng.wang@hxt-semitech.com>
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 <dongsheng.wang@hxt-semitech.com>
---
.../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
next prev parent reply other threads:[~2018-09-05 2:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 2:27 [PATCH v2 1/2] net: ethernet: i40e: fix " Wang Dongsheng
2018-09-05 2:27 ` Wang Dongsheng [this message]
2018-09-05 16:52 ` [PATCH v2 2/2] net: ethernet: i40evf: fix potential " Keller, Jacob E
2018-09-07 7:25 ` kbuild test robot
2018-09-05 16:52 ` [PATCH v2 1/2] net: ethernet: i40e: fix " Keller, Jacob E
[not found] ` <eab442369533452a9fc138e310aa57b9@HXTBJIDCEMVIW02.hxtcorp.net>
2018-09-06 17:16 ` Keller, Jacob E
2018-09-06 18:03 ` Andrew Lunn
2018-09-06 18:15 ` Wyborny, Carolyn
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=1536114430-21356-2-git-send-email-dongsheng.wang@hxt-semitech.com \
--to=dongsheng.wang@hxt-semitech.com \
--cc=davem@davemloft.net \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.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
all inboxes | Powered by JetHome®