Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: efx_default_channel_type APIs can be static

This means we can remove them from efx_channel.h and avoid
naming conflicts later.
efx_channel_dummy_op_void() cannot be static as it is
used in ef100_nic.c.

Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Martin Habets and committed by
Paolo Abeni
54fccfdd 80ecb114

+28 -28
+28 -24
drivers/net/ethernet/sfc/efx_channels.c
··· 51 51 */ 52 52 static int napi_weight = 64; 53 53 54 - /*************** 55 - * Housekeeping 56 - ***************/ 57 - 58 - int efx_channel_dummy_op_int(struct efx_channel *channel) 59 - { 60 - return 0; 61 - } 62 - 63 - void efx_channel_dummy_op_void(struct efx_channel *channel) 64 - { 65 - } 66 - 67 - static const struct efx_channel_type efx_default_channel_type = { 68 - .pre_probe = efx_channel_dummy_op_int, 69 - .post_remove = efx_channel_dummy_op_void, 70 - .get_name = efx_get_channel_name, 71 - .copy = efx_copy_channel, 72 - .want_txqs = efx_default_channel_want_txqs, 73 - .keep_eventq = false, 74 - .want_pio = true, 75 - }; 54 + static const struct efx_channel_type efx_default_channel_type; 76 55 77 56 /************* 78 57 * INTERRUPTS ··· 598 619 /* Allocate and initialise a channel structure, copying parameters 599 620 * (but not resources) from an old channel structure. 600 621 */ 622 + static 601 623 struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel) 602 624 { 603 625 struct efx_rx_queue *rx_queue; ··· 676 696 return rc; 677 697 } 678 698 679 - void efx_get_channel_name(struct efx_channel *channel, char *buf, size_t len) 699 + static void efx_get_channel_name(struct efx_channel *channel, char *buf, 700 + size_t len) 680 701 { 681 702 struct efx_nic *efx = channel->efx; 682 703 const char *type; ··· 985 1004 return netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels); 986 1005 } 987 1006 988 - bool efx_default_channel_want_txqs(struct efx_channel *channel) 1007 + static bool efx_default_channel_want_txqs(struct efx_channel *channel) 989 1008 { 990 1009 return channel->channel - channel->efx->tx_channel_offset < 991 1010 channel->efx->n_tx_channels; ··· 1343 1362 efx_for_each_channel(channel, efx) 1344 1363 efx_fini_napi_channel(channel); 1345 1364 } 1365 + 1366 + /*************** 1367 + * Housekeeping 1368 + ***************/ 1369 + 1370 + static int efx_channel_dummy_op_int(struct efx_channel *channel) 1371 + { 1372 + return 0; 1373 + } 1374 + 1375 + void efx_channel_dummy_op_void(struct efx_channel *channel) 1376 + { 1377 + } 1378 + 1379 + static const struct efx_channel_type efx_default_channel_type = { 1380 + .pre_probe = efx_channel_dummy_op_int, 1381 + .post_remove = efx_channel_dummy_op_void, 1382 + .get_name = efx_get_channel_name, 1383 + .copy = efx_copy_channel, 1384 + .want_txqs = efx_default_channel_want_txqs, 1385 + .keep_eventq = false, 1386 + .want_pio = true, 1387 + };
-4
drivers/net/ethernet/sfc/efx_channels.h
··· 32 32 void efx_remove_eventq(struct efx_channel *channel); 33 33 34 34 int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries); 35 - void efx_get_channel_name(struct efx_channel *channel, char *buf, size_t len); 36 35 void efx_set_channel_names(struct efx_nic *efx); 37 36 int efx_init_channels(struct efx_nic *efx); 38 37 int efx_probe_channels(struct efx_nic *efx); 39 38 int efx_set_channels(struct efx_nic *efx); 40 - bool efx_default_channel_want_txqs(struct efx_channel *channel); 41 39 void efx_remove_channel(struct efx_channel *channel); 42 40 void efx_remove_channels(struct efx_nic *efx); 43 41 void efx_fini_channels(struct efx_nic *efx); 44 - struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel); 45 42 void efx_start_channels(struct efx_nic *efx); 46 43 void efx_stop_channels(struct efx_nic *efx); 47 44 ··· 47 50 void efx_fini_napi_channel(struct efx_channel *channel); 48 51 void efx_fini_napi(struct efx_nic *efx); 49 52 50 - int efx_channel_dummy_op_int(struct efx_channel *channel); 51 53 void efx_channel_dummy_op_void(struct efx_channel *channel); 52 54 53 55 #endif