Commit d215697fe14a0c5a96765c6279b4751e632587a5
Committed by
David S. Miller
1 parent
d028023281
Exists in
master
and in
7 other branches
sfc: make functions static
Make local functions and variable static. Do some rearrangement of the string table stuff to put it where it gets used. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 12 changed files with 26 additions and 41 deletions Side-by-side Diff
drivers/net/sfc/efx.c
... | ... | @@ -68,14 +68,6 @@ |
68 | 68 | [LOOPBACK_PHYXS_WS] = "PHYXS_WS", |
69 | 69 | }; |
70 | 70 | |
71 | -/* Interrupt mode names (see INT_MODE())) */ | |
72 | -const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX; | |
73 | -const char *efx_interrupt_mode_names[] = { | |
74 | - [EFX_INT_MODE_MSIX] = "MSI-X", | |
75 | - [EFX_INT_MODE_MSI] = "MSI", | |
76 | - [EFX_INT_MODE_LEGACY] = "legacy", | |
77 | -}; | |
78 | - | |
79 | 71 | const unsigned int efx_reset_type_max = RESET_TYPE_MAX; |
80 | 72 | const char *efx_reset_type_names[] = { |
81 | 73 | [RESET_TYPE_INVISIBLE] = "INVISIBLE", |
... | ... | @@ -128,7 +120,7 @@ |
128 | 120 | * - Check the on-board hardware monitor; |
129 | 121 | * - Poll the link state and reconfigure the hardware as necessary. |
130 | 122 | */ |
131 | -unsigned int efx_monitor_interval = 1 * HZ; | |
123 | +static unsigned int efx_monitor_interval = 1 * HZ; | |
132 | 124 | |
133 | 125 | /* This controls whether or not the driver will initialise devices |
134 | 126 | * with invalid MAC addresses stored in the EEPROM or flash. If true, |
... | ... | @@ -2180,10 +2172,8 @@ |
2180 | 2172 | return 0; |
2181 | 2173 | } |
2182 | 2174 | void efx_port_dummy_op_void(struct efx_nic *efx) {} |
2183 | -void efx_port_dummy_op_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) | |
2184 | -{ | |
2185 | -} | |
2186 | -bool efx_port_dummy_op_poll(struct efx_nic *efx) | |
2175 | + | |
2176 | +static bool efx_port_dummy_op_poll(struct efx_nic *efx) | |
2187 | 2177 | { |
2188 | 2178 | return false; |
2189 | 2179 | } |
drivers/net/sfc/efx.h
... | ... | @@ -88,10 +88,6 @@ |
88 | 88 | extern int __efx_reconfigure_port(struct efx_nic *efx); |
89 | 89 | |
90 | 90 | /* Ethtool support */ |
91 | -extern int efx_ethtool_get_settings(struct net_device *net_dev, | |
92 | - struct ethtool_cmd *ecmd); | |
93 | -extern int efx_ethtool_set_settings(struct net_device *net_dev, | |
94 | - struct ethtool_cmd *ecmd); | |
95 | 91 | extern const struct ethtool_ops efx_ethtool_ops; |
96 | 92 | |
97 | 93 | /* Reset handling */ |
98 | 94 | |
... | ... | @@ -107,10 +103,8 @@ |
107 | 103 | /* Dummy PHY ops for PHY drivers */ |
108 | 104 | extern int efx_port_dummy_op_int(struct efx_nic *efx); |
109 | 105 | extern void efx_port_dummy_op_void(struct efx_nic *efx); |
110 | -extern void | |
111 | -efx_port_dummy_op_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); | |
112 | -extern bool efx_port_dummy_op_poll(struct efx_nic *efx); | |
113 | 106 | |
107 | + | |
114 | 108 | /* MTD */ |
115 | 109 | #ifdef CONFIG_SFC_MTD |
116 | 110 | extern int efx_mtd_probe(struct efx_nic *efx); |
... | ... | @@ -121,8 +115,6 @@ |
121 | 115 | static inline void efx_mtd_rename(struct efx_nic *efx) {} |
122 | 116 | static inline void efx_mtd_remove(struct efx_nic *efx) {} |
123 | 117 | #endif |
124 | - | |
125 | -extern unsigned int efx_monitor_interval; | |
126 | 118 | |
127 | 119 | static inline void efx_schedule_channel(struct efx_channel *channel) |
128 | 120 | { |
drivers/net/sfc/ethtool.c
... | ... | @@ -187,8 +187,8 @@ |
187 | 187 | } |
188 | 188 | |
189 | 189 | /* This must be called with rtnl_lock held. */ |
190 | -int efx_ethtool_get_settings(struct net_device *net_dev, | |
191 | - struct ethtool_cmd *ecmd) | |
190 | +static int efx_ethtool_get_settings(struct net_device *net_dev, | |
191 | + struct ethtool_cmd *ecmd) | |
192 | 192 | { |
193 | 193 | struct efx_nic *efx = netdev_priv(net_dev); |
194 | 194 | struct efx_link_state *link_state = &efx->link_state; |
... | ... | @@ -211,8 +211,8 @@ |
211 | 211 | } |
212 | 212 | |
213 | 213 | /* This must be called with rtnl_lock held. */ |
214 | -int efx_ethtool_set_settings(struct net_device *net_dev, | |
215 | - struct ethtool_cmd *ecmd) | |
214 | +static int efx_ethtool_set_settings(struct net_device *net_dev, | |
215 | + struct ethtool_cmd *ecmd) | |
216 | 216 | { |
217 | 217 | struct efx_nic *efx = netdev_priv(net_dev); |
218 | 218 | int rc; |
... | ... | @@ -891,7 +891,7 @@ |
891 | 891 | return efx->type->set_wol(efx, wol->wolopts); |
892 | 892 | } |
893 | 893 | |
894 | -extern int efx_ethtool_reset(struct net_device *net_dev, u32 *flags) | |
894 | +static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags) | |
895 | 895 | { |
896 | 896 | struct efx_nic *efx = netdev_priv(net_dev); |
897 | 897 | enum reset_type method; |
drivers/net/sfc/falcon_xmac.c
drivers/net/sfc/mac.h
... | ... | @@ -15,7 +15,6 @@ |
15 | 15 | |
16 | 16 | extern struct efx_mac_operations falcon_xmac_operations; |
17 | 17 | extern struct efx_mac_operations efx_mcdi_mac_operations; |
18 | -extern void falcon_reconfigure_xmac_core(struct efx_nic *efx); | |
19 | 18 | extern int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr, |
20 | 19 | u32 dma_len, int enable, int clear); |
21 | 20 |
drivers/net/sfc/mcdi.c
... | ... | @@ -1093,8 +1093,8 @@ |
1093 | 1093 | return rc; |
1094 | 1094 | } |
1095 | 1095 | |
1096 | -int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, | |
1097 | - const u8 *mac, int *id_out) | |
1096 | +static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, | |
1097 | + const u8 *mac, int *id_out) | |
1098 | 1098 | { |
1099 | 1099 | u8 inbuf[MC_CMD_WOL_FILTER_SET_IN_LEN]; |
1100 | 1100 | u8 outbuf[MC_CMD_WOL_FILTER_SET_OUT_LEN]; |
drivers/net/sfc/mcdi.h
... | ... | @@ -121,8 +121,6 @@ |
121 | 121 | extern void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); |
122 | 122 | extern int efx_mcdi_reset_port(struct efx_nic *efx); |
123 | 123 | extern int efx_mcdi_reset_mc(struct efx_nic *efx); |
124 | -extern int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, | |
125 | - const u8 *mac, int *id_out); | |
126 | 124 | extern int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, |
127 | 125 | const u8 *mac, int *id_out); |
128 | 126 | extern int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); |
drivers/net/sfc/mcdi_phy.c
... | ... | @@ -713,7 +713,8 @@ |
713 | 713 | return 0; |
714 | 714 | } |
715 | 715 | |
716 | -const char *efx_mcdi_phy_test_name(struct efx_nic *efx, unsigned int index) | |
716 | +static const char *efx_mcdi_phy_test_name(struct efx_nic *efx, | |
717 | + unsigned int index) | |
717 | 718 | { |
718 | 719 | struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; |
719 | 720 |
drivers/net/sfc/net_driver.h
... | ... | @@ -387,11 +387,6 @@ |
387 | 387 | #define LOOPBACK_MODE(efx) \ |
388 | 388 | STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode) |
389 | 389 | |
390 | -extern const char *efx_interrupt_mode_names[]; | |
391 | -extern const unsigned int efx_interrupt_mode_max; | |
392 | -#define INT_MODE(efx) \ | |
393 | - STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode) | |
394 | - | |
395 | 390 | extern const char *efx_reset_type_names[]; |
396 | 391 | extern const unsigned int efx_reset_type_max; |
397 | 392 | #define RESET_TYPE(type) \ |
drivers/net/sfc/nic.c
... | ... | @@ -653,7 +653,7 @@ |
653 | 653 | } |
654 | 654 | |
655 | 655 | /* Use HW to insert a SW defined event */ |
656 | -void efx_generate_event(struct efx_channel *channel, efx_qword_t *event) | |
656 | +static void efx_generate_event(struct efx_channel *channel, efx_qword_t *event) | |
657 | 657 | { |
658 | 658 | efx_oword_t drv_ev_reg; |
659 | 659 |
drivers/net/sfc/selftest.c
... | ... | @@ -48,6 +48,16 @@ |
48 | 48 | static const char payload_msg[] = |
49 | 49 | "Hello world! This is an Efx loopback test in progress!"; |
50 | 50 | |
51 | +/* Interrupt mode names */ | |
52 | +static const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX; | |
53 | +static const char *efx_interrupt_mode_names[] = { | |
54 | + [EFX_INT_MODE_MSIX] = "MSI-X", | |
55 | + [EFX_INT_MODE_MSI] = "MSI", | |
56 | + [EFX_INT_MODE_LEGACY] = "legacy", | |
57 | +}; | |
58 | +#define INT_MODE(efx) \ | |
59 | + STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode) | |
60 | + | |
51 | 61 | /** |
52 | 62 | * efx_loopback_state - persistent state during a loopback selftest |
53 | 63 | * @flush: Drop all packets in efx_loopback_rx_packet |
drivers/net/sfc/siena.c