Skip to content

Commit 57f16c9

Browse files
committed
iavf: make functions static where possible
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-284.30.1.el9_2 commit-author Przemek Kitszel <[email protected]> commit a4aadf0 Make all possible functions static. Move iavf_force_wb() up to avoid forward declaration. Suggested-by: Maciej Fijalkowski <[email protected]> Reviewed-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> (cherry picked from commit a4aadf0) Signed-off-by: Jonathan Maple <[email protected]>
1 parent e75a0f6 commit 57f16c9

File tree

4 files changed

+28
-43
lines changed

4 files changed

+28
-43
lines changed

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,6 @@ void iavf_schedule_request_stats(struct iavf_adapter *adapter);
519519
void iavf_reset(struct iavf_adapter *adapter);
520520
void iavf_set_ethtool_ops(struct net_device *netdev);
521521
void iavf_update_stats(struct iavf_adapter *adapter);
522-
void iavf_reset_interrupt_capability(struct iavf_adapter *adapter);
523-
int iavf_init_interrupt_scheme(struct iavf_adapter *adapter);
524-
void iavf_irq_enable_queues(struct iavf_adapter *adapter);
525522
void iavf_free_all_tx_resources(struct iavf_adapter *adapter);
526523
void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
527524

@@ -575,17 +572,10 @@ void iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
575572
void iavf_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
576573
void iavf_enable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
577574
void iavf_disable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
578-
int iavf_replace_primary_mac(struct iavf_adapter *adapter,
579-
const u8 *new_mac);
580-
void
581-
iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
582-
netdev_features_t prev_features,
583-
netdev_features_t features);
584575
void iavf_add_fdir_filter(struct iavf_adapter *adapter);
585576
void iavf_del_fdir_filter(struct iavf_adapter *adapter);
586577
void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
587578
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
588579
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
589580
const u8 *macaddr);
590-
int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
591581
#endif /* _IAVF_H_ */

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem)
245245
*
246246
* Returns 0 on success, negative on failure
247247
**/
248-
int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
248+
static int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
249249
{
250250
unsigned int wait, delay = 10;
251251

@@ -354,7 +354,7 @@ static void iavf_irq_disable(struct iavf_adapter *adapter)
354354
* iavf_irq_enable_queues - Enable interrupt for all queues
355355
* @adapter: board private structure
356356
**/
357-
void iavf_irq_enable_queues(struct iavf_adapter *adapter)
357+
static void iavf_irq_enable_queues(struct iavf_adapter *adapter)
358358
{
359359
struct iavf_hw *hw = &adapter->hw;
360360
int i;
@@ -988,8 +988,8 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
988988
*
989989
* Do not call this with mac_vlan_list_lock!
990990
**/
991-
int iavf_replace_primary_mac(struct iavf_adapter *adapter,
992-
const u8 *new_mac)
991+
static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
992+
const u8 *new_mac)
993993
{
994994
struct iavf_hw *hw = &adapter->hw;
995995
struct iavf_mac_filter *new_f;
@@ -1849,7 +1849,7 @@ static void iavf_free_q_vectors(struct iavf_adapter *adapter)
18491849
* @adapter: board private structure
18501850
*
18511851
**/
1852-
void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
1852+
static void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
18531853
{
18541854
if (!adapter->msix_entries)
18551855
return;
@@ -1864,7 +1864,7 @@ void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
18641864
* @adapter: board private structure to initialize
18651865
*
18661866
**/
1867-
int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
1867+
static int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
18681868
{
18691869
int err;
18701870

@@ -2162,7 +2162,7 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
21622162
* the watchdog if any changes are requested to expedite the request via
21632163
* virtchnl.
21642164
**/
2165-
void
2165+
static void
21662166
iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
21672167
netdev_features_t prev_features,
21682168
netdev_features_t features)

drivers/net/ethernet/intel/iavf/iavf_txrx.c

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void iavf_unmap_and_free_tx_resource(struct iavf_ring *ring,
5454
* iavf_clean_tx_ring - Free any empty Tx buffers
5555
* @tx_ring: ring to be cleaned
5656
**/
57-
void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
57+
static void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
5858
{
5959
unsigned long bi_size;
6060
u16 i;
@@ -110,7 +110,7 @@ void iavf_free_tx_resources(struct iavf_ring *tx_ring)
110110
* Since there is no access to the ring head register
111111
* in XL710, we need to use our local copies
112112
**/
113-
u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
113+
static u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
114114
{
115115
u32 head, tail;
116116

@@ -127,6 +127,24 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
127127
return 0;
128128
}
129129

130+
/**
131+
* iavf_force_wb - Issue SW Interrupt so HW does a wb
132+
* @vsi: the VSI we care about
133+
* @q_vector: the vector on which to force writeback
134+
**/
135+
static void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
136+
{
137+
u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
138+
IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
139+
IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
140+
IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
141+
/* allow 00 to be written to the index */;
142+
143+
wr32(&vsi->back->hw,
144+
IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
145+
val);
146+
}
147+
130148
/**
131149
* iavf_detect_recover_hung - Function to detect and recover hung_queues
132150
* @vsi: pointer to vsi struct with tx queues
@@ -352,25 +370,6 @@ static void iavf_enable_wb_on_itr(struct iavf_vsi *vsi,
352370
q_vector->arm_wb_state = true;
353371
}
354372

355-
/**
356-
* iavf_force_wb - Issue SW Interrupt so HW does a wb
357-
* @vsi: the VSI we care about
358-
* @q_vector: the vector on which to force writeback
359-
*
360-
**/
361-
void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
362-
{
363-
u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
364-
IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
365-
IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
366-
IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
367-
/* allow 00 to be written to the index */;
368-
369-
wr32(&vsi->back->hw,
370-
IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
371-
val);
372-
}
373-
374373
static inline bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
375374
struct iavf_ring_container *rc)
376375
{
@@ -687,7 +686,7 @@ int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring)
687686
* iavf_clean_rx_ring - Free Rx buffers
688687
* @rx_ring: ring to be cleaned
689688
**/
690-
void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
689+
static void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
691690
{
692691
unsigned long bi_size;
693692
u16 i;

drivers/net/ethernet/intel/iavf/iavf_txrx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,11 @@ static inline unsigned int iavf_rx_pg_order(struct iavf_ring *ring)
442442

443443
bool iavf_alloc_rx_buffers(struct iavf_ring *rxr, u16 cleaned_count);
444444
netdev_tx_t iavf_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
445-
void iavf_clean_tx_ring(struct iavf_ring *tx_ring);
446-
void iavf_clean_rx_ring(struct iavf_ring *rx_ring);
447445
int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring);
448446
int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring);
449447
void iavf_free_tx_resources(struct iavf_ring *tx_ring);
450448
void iavf_free_rx_resources(struct iavf_ring *rx_ring);
451449
int iavf_napi_poll(struct napi_struct *napi, int budget);
452-
void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector);
453-
u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw);
454450
void iavf_detect_recover_hung(struct iavf_vsi *vsi);
455451
int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size);
456452
bool __iavf_chk_linearize(struct sk_buff *skb);

0 commit comments

Comments
 (0)