Commit de445199 authored by Jeff Kirsher's avatar Jeff Kirsher

fm10k: fix unused warnings

The were several functions which had parameters which were never or
sometimes used in functions.  To resolve possible compiler warnings,
use __always_unused or __maybe_unused kernel macros to resolve.
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Acked-by: default avatarMatthew Vick <matthew.vick@intel.com>
Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 8b4a98c7
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 2015 Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -128,7 +128,7 @@ static int fm10k_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc) ...@@ -128,7 +128,7 @@ static int fm10k_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc)
* *
* Returns that we support only IEEE DCB for this interface * Returns that we support only IEEE DCB for this interface
**/ **/
static u8 fm10k_dcbnl_getdcbx(struct net_device *dev) static u8 fm10k_dcbnl_getdcbx(struct net_device __always_unused *dev)
{ {
return DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE; return DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
} }
...@@ -140,7 +140,7 @@ static u8 fm10k_dcbnl_getdcbx(struct net_device *dev) ...@@ -140,7 +140,7 @@ static u8 fm10k_dcbnl_getdcbx(struct net_device *dev)
* *
* Returns error on attempt to enable anything but IEEE DCB for this interface * Returns error on attempt to enable anything but IEEE DCB for this interface
**/ **/
static u8 fm10k_dcbnl_setdcbx(struct net_device *dev, u8 mode) static u8 fm10k_dcbnl_setdcbx(struct net_device __always_unused *dev, u8 mode)
{ {
return (mode != (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE)) ? 1 : 0; return (mode != (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE)) ? 1 : 0;
} }
......
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 2015 Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -36,14 +36,16 @@ static void *fm10k_dbg_desc_seq_start(struct seq_file *s, loff_t *pos) ...@@ -36,14 +36,16 @@ static void *fm10k_dbg_desc_seq_start(struct seq_file *s, loff_t *pos)
return (*pos < ring->count) ? pos : NULL; return (*pos < ring->count) ? pos : NULL;
} }
static void *fm10k_dbg_desc_seq_next(struct seq_file *s, void *v, loff_t *pos) static void *fm10k_dbg_desc_seq_next(struct seq_file *s,
void __always_unused *v, loff_t *pos)
{ {
struct fm10k_ring *ring = s->private; struct fm10k_ring *ring = s->private;
return (++(*pos) < ring->count) ? pos : NULL; return (++(*pos) < ring->count) ? pos : NULL;
} }
static void fm10k_dbg_desc_seq_stop(struct seq_file *s, void *v) static void fm10k_dbg_desc_seq_stop(struct seq_file __always_unused *s,
__always_unused void *v)
{ {
/* Do nothing. */ /* Do nothing. */
} }
......
...@@ -116,8 +116,7 @@ enum fm10k_self_test_types { ...@@ -116,8 +116,7 @@ enum fm10k_self_test_types {
FM10K_TEST_MAX = FM10K_TEST_LEN FM10K_TEST_MAX = FM10K_TEST_LEN
}; };
static void fm10k_get_strings(struct net_device *dev, u32 stringset, static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
u8 *data)
{ {
char *p = (char *)data; char *p = (char *)data;
int i; int i;
...@@ -166,7 +165,8 @@ static int fm10k_get_sset_count(struct net_device *dev, int sset) ...@@ -166,7 +165,8 @@ static int fm10k_get_sset_count(struct net_device *dev, int sset)
} }
static void fm10k_get_ethtool_stats(struct net_device *netdev, static void fm10k_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data) struct ethtool_stats __always_unused *stats,
u64 *data)
{ {
const int stat_count = sizeof(struct fm10k_queue_stats) / sizeof(u64); const int stat_count = sizeof(struct fm10k_queue_stats) / sizeof(u64);
struct fm10k_intfc *interface = netdev_priv(netdev); struct fm10k_intfc *interface = netdev_priv(netdev);
...@@ -644,7 +644,7 @@ static int fm10k_get_rss_hash_opts(struct fm10k_intfc *interface, ...@@ -644,7 +644,7 @@ static int fm10k_get_rss_hash_opts(struct fm10k_intfc *interface,
} }
static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
u32 *rule_locs) u32 __always_unused *rule_locs)
{ {
struct fm10k_intfc *interface = netdev_priv(dev); struct fm10k_intfc *interface = netdev_priv(dev);
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
...@@ -850,7 +850,7 @@ static void fm10k_self_test(struct net_device *dev, ...@@ -850,7 +850,7 @@ static void fm10k_self_test(struct net_device *dev,
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
} }
static u32 fm10k_get_reta_size(struct net_device *netdev) static u32 fm10k_get_reta_size(struct net_device __always_unused *netdev)
{ {
return FM10K_RETA_SIZE * FM10K_RETA_ENTRIES_PER_REG; return FM10K_RETA_SIZE * FM10K_RETA_ENTRIES_PER_REG;
} }
...@@ -910,7 +910,7 @@ static int fm10k_set_reta(struct net_device *netdev, const u32 *indir) ...@@ -910,7 +910,7 @@ static int fm10k_set_reta(struct net_device *netdev, const u32 *indir)
return 0; return 0;
} }
static u32 fm10k_get_rssrk_size(struct net_device *netdev) static u32 fm10k_get_rssrk_size(struct net_device __always_unused *netdev)
{ {
return FM10K_RSSRK_SIZE * FM10K_RSSRK_ENTRIES_PER_REG; return FM10K_RSSRK_SIZE * FM10K_RSSRK_ENTRIES_PER_REG;
} }
......
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 2015 Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -488,8 +488,8 @@ int fm10k_ndo_set_vf_vlan(struct net_device *netdev, int vf_idx, u16 vid, ...@@ -488,8 +488,8 @@ int fm10k_ndo_set_vf_vlan(struct net_device *netdev, int vf_idx, u16 vid,
return 0; return 0;
} }
int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx, int unused, int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx,
int rate) int __always_unused unused, int rate)
{ {
struct fm10k_intfc *interface = netdev_priv(netdev); struct fm10k_intfc *interface = netdev_priv(netdev);
struct fm10k_iov_data *iov_data = interface->iov_data; struct fm10k_iov_data *iov_data = interface->iov_data;
......
...@@ -209,7 +209,7 @@ static inline bool fm10k_page_is_reserved(struct page *page) ...@@ -209,7 +209,7 @@ static inline bool fm10k_page_is_reserved(struct page *page)
static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer, static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
struct page *page, struct page *page,
unsigned int truesize) unsigned int __maybe_unused truesize)
{ {
/* avoid re-using remote pages */ /* avoid re-using remote pages */
if (unlikely(fm10k_page_is_reserved(page))) if (unlikely(fm10k_page_is_reserved(page)))
...@@ -240,7 +240,6 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer, ...@@ -240,7 +240,6 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
/** /**
* fm10k_add_rx_frag - Add contents of Rx buffer to sk_buff * fm10k_add_rx_frag - Add contents of Rx buffer to sk_buff
* @rx_ring: rx descriptor ring to transact packets on
* @rx_buffer: buffer containing page to add * @rx_buffer: buffer containing page to add
* @rx_desc: descriptor containing length of buffer written by hardware * @rx_desc: descriptor containing length of buffer written by hardware
* @skb: sk_buff to place the data into * @skb: sk_buff to place the data into
...@@ -253,8 +252,7 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer, ...@@ -253,8 +252,7 @@ static bool fm10k_can_reuse_rx_page(struct fm10k_rx_buffer *rx_buffer,
* The function will then update the page offset if necessary and return * The function will then update the page offset if necessary and return
* true if the buffer can be reused by the interface. * true if the buffer can be reused by the interface.
**/ **/
static bool fm10k_add_rx_frag(struct fm10k_ring *rx_ring, static bool fm10k_add_rx_frag(struct fm10k_rx_buffer *rx_buffer,
struct fm10k_rx_buffer *rx_buffer,
union fm10k_rx_desc *rx_desc, union fm10k_rx_desc *rx_desc,
struct sk_buff *skb) struct sk_buff *skb)
{ {
...@@ -330,7 +328,7 @@ static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring, ...@@ -330,7 +328,7 @@ static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
/* pull page into skb */ /* pull page into skb */
if (fm10k_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) { if (fm10k_add_rx_frag(rx_buffer, rx_desc, skb)) {
/* hand second half of page back to the ring */ /* hand second half of page back to the ring */
fm10k_reuse_rx_page(rx_ring, rx_buffer); fm10k_reuse_rx_page(rx_ring, rx_buffer);
} else { } else {
...@@ -412,7 +410,7 @@ static void fm10k_rx_hwtstamp(struct fm10k_ring *rx_ring, ...@@ -412,7 +410,7 @@ static void fm10k_rx_hwtstamp(struct fm10k_ring *rx_ring,
} }
static void fm10k_type_trans(struct fm10k_ring *rx_ring, static void fm10k_type_trans(struct fm10k_ring *rx_ring,
union fm10k_rx_desc *rx_desc, union fm10k_rx_desc __maybe_unused *rx_desc,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct net_device *dev = rx_ring->netdev; struct net_device *dev = rx_ring->netdev;
...@@ -509,8 +507,6 @@ static bool fm10k_is_non_eop(struct fm10k_ring *rx_ring, ...@@ -509,8 +507,6 @@ static bool fm10k_is_non_eop(struct fm10k_ring *rx_ring,
/** /**
* fm10k_pull_tail - fm10k specific version of skb_pull_tail * fm10k_pull_tail - fm10k specific version of skb_pull_tail
* @rx_ring: rx descriptor ring packet is being transacted on
* @rx_desc: pointer to the EOP Rx descriptor
* @skb: pointer to current skb being adjusted * @skb: pointer to current skb being adjusted
* *
* This function is an fm10k specific version of __pskb_pull_tail. The * This function is an fm10k specific version of __pskb_pull_tail. The
...@@ -520,9 +516,7 @@ static bool fm10k_is_non_eop(struct fm10k_ring *rx_ring, ...@@ -520,9 +516,7 @@ static bool fm10k_is_non_eop(struct fm10k_ring *rx_ring,
* As a result we can do things like drop a frag and maintain an accurate * As a result we can do things like drop a frag and maintain an accurate
* truesize for the skb. * truesize for the skb.
*/ */
static void fm10k_pull_tail(struct fm10k_ring *rx_ring, static void fm10k_pull_tail(struct sk_buff *skb)
union fm10k_rx_desc *rx_desc,
struct sk_buff *skb)
{ {
struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0]; struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
unsigned char *va; unsigned char *va;
...@@ -576,7 +570,7 @@ static bool fm10k_cleanup_headers(struct fm10k_ring *rx_ring, ...@@ -576,7 +570,7 @@ static bool fm10k_cleanup_headers(struct fm10k_ring *rx_ring,
/* place header in linear portion of buffer */ /* place header in linear portion of buffer */
if (skb_is_nonlinear(skb)) if (skb_is_nonlinear(skb))
fm10k_pull_tail(rx_ring, rx_desc, skb); fm10k_pull_tail(skb);
/* if eth_skb_pad returns an error the skb was freed */ /* if eth_skb_pad returns an error the skb was freed */
if (eth_skb_pad(skb)) if (eth_skb_pad(skb))
......
...@@ -807,7 +807,7 @@ static void fm10k_napi_enable_all(struct fm10k_intfc *interface) ...@@ -807,7 +807,7 @@ static void fm10k_napi_enable_all(struct fm10k_intfc *interface)
} }
} }
static irqreturn_t fm10k_msix_clean_rings(int irq, void *data) static irqreturn_t fm10k_msix_clean_rings(int __always_unused irq, void *data)
{ {
struct fm10k_q_vector *q_vector = data; struct fm10k_q_vector *q_vector = data;
...@@ -817,7 +817,7 @@ static irqreturn_t fm10k_msix_clean_rings(int irq, void *data) ...@@ -817,7 +817,7 @@ static irqreturn_t fm10k_msix_clean_rings(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static irqreturn_t fm10k_msix_mbx_vf(int irq, void *data) static irqreturn_t fm10k_msix_mbx_vf(int __always_unused irq, void *data)
{ {
struct fm10k_intfc *interface = data; struct fm10k_intfc *interface = data;
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
...@@ -985,7 +985,7 @@ static void fm10k_reset_drop_on_empty(struct fm10k_intfc *interface, u32 eicr) ...@@ -985,7 +985,7 @@ static void fm10k_reset_drop_on_empty(struct fm10k_intfc *interface, u32 eicr)
} }
} }
static irqreturn_t fm10k_msix_mbx_pf(int irq, void *data) static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data)
{ {
struct fm10k_intfc *interface = data; struct fm10k_intfc *interface = data;
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
...@@ -1090,7 +1090,7 @@ static s32 fm10k_mbx_mac_addr(struct fm10k_hw *hw, u32 **results, ...@@ -1090,7 +1090,7 @@ static s32 fm10k_mbx_mac_addr(struct fm10k_hw *hw, u32 **results,
} }
static s32 fm10k_1588_msg_vf(struct fm10k_hw *hw, u32 **results, static s32 fm10k_1588_msg_vf(struct fm10k_hw *hw, u32 **results,
struct fm10k_mbx_info *mbx) struct fm10k_mbx_info __always_unused *mbx)
{ {
struct fm10k_intfc *interface; struct fm10k_intfc *interface;
u64 timestamp; u64 timestamp;
...@@ -1110,7 +1110,7 @@ static s32 fm10k_1588_msg_vf(struct fm10k_hw *hw, u32 **results, ...@@ -1110,7 +1110,7 @@ static s32 fm10k_1588_msg_vf(struct fm10k_hw *hw, u32 **results,
/* generic error handler for mailbox issues */ /* generic error handler for mailbox issues */
static s32 fm10k_mbx_error(struct fm10k_hw *hw, u32 **results, static s32 fm10k_mbx_error(struct fm10k_hw *hw, u32 **results,
struct fm10k_mbx_info *mbx) struct fm10k_mbx_info __always_unused *mbx)
{ {
struct fm10k_intfc *interface; struct fm10k_intfc *interface;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -1186,7 +1186,7 @@ static s32 fm10k_lport_map(struct fm10k_hw *hw, u32 **results, ...@@ -1186,7 +1186,7 @@ static s32 fm10k_lport_map(struct fm10k_hw *hw, u32 **results,
} }
static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results, static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results,
struct fm10k_mbx_info *mbx) struct fm10k_mbx_info __always_unused *mbx)
{ {
struct fm10k_intfc *interface; struct fm10k_intfc *interface;
u16 glort, pvid; u16 glort, pvid;
...@@ -1227,7 +1227,7 @@ static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results, ...@@ -1227,7 +1227,7 @@ static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results,
} }
static s32 fm10k_1588_msg_pf(struct fm10k_hw *hw, u32 **results, static s32 fm10k_1588_msg_pf(struct fm10k_hw *hw, u32 **results,
struct fm10k_mbx_info *mbx) struct fm10k_mbx_info __always_unused *mbx)
{ {
struct fm10k_swapi_1588_timestamp timestamp; struct fm10k_swapi_1588_timestamp timestamp;
struct fm10k_iov_data *iov_data; struct fm10k_iov_data *iov_data;
...@@ -2005,7 +2005,8 @@ static int fm10k_resume(struct pci_dev *pdev) ...@@ -2005,7 +2005,8 @@ static int fm10k_resume(struct pci_dev *pdev)
* a sleep state. The fm10k hardware does not support wake on lan so the * a sleep state. The fm10k hardware does not support wake on lan so the
* driver simply needs to shut down the device so it is in a low power state. * driver simply needs to shut down the device so it is in a low power state.
**/ **/
static int fm10k_suspend(struct pci_dev *pdev, pm_message_t state) static int fm10k_suspend(struct pci_dev *pdev,
pm_message_t __always_unused state)
{ {
struct fm10k_intfc *interface = pci_get_drvdata(pdev); struct fm10k_intfc *interface = pci_get_drvdata(pdev);
struct net_device *netdev = interface->netdev; struct net_device *netdev = interface->netdev;
......
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 2015 Intel Corporation.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
...@@ -319,7 +319,8 @@ static int fm10k_ptp_settime(struct ptp_clock_info *ptp, ...@@ -319,7 +319,8 @@ static int fm10k_ptp_settime(struct ptp_clock_info *ptp,
} }
static int fm10k_ptp_enable(struct ptp_clock_info *ptp, static int fm10k_ptp_enable(struct ptp_clock_info *ptp,
struct ptp_clock_request *rq, int on) struct ptp_clock_request *rq,
int __always_unused on)
{ {
struct ptp_clock_time *t = &rq->perout.period; struct ptp_clock_time *t = &rq->perout.period;
struct fm10k_intfc *interface; struct fm10k_intfc *interface;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment