Skip to content

Commit cef6ff2

Browse files
julianwiedmanndavem330
authored andcommitted
s390/net: reduce inlining
Clean up the inline cruft in s390 net drivers. Many of the inlined functions had only one caller anyway. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f8eb493 commit cef6ff2

File tree

7 files changed

+67
-74
lines changed

7 files changed

+67
-74
lines changed

drivers/s390/net/ctcm_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static long ctcm_check_irb_error(struct ccw_device *cdev, struct irb *irb)
305305
* ch The channel, the sense code belongs to.
306306
* sense The sense code to inspect.
307307
*/
308-
static inline void ccw_unit_check(struct channel *ch, __u8 sense)
308+
static void ccw_unit_check(struct channel *ch, __u8 sense)
309309
{
310310
CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG,
311311
"%s(%s): %02x",

drivers/s390/net/lcs.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,7 @@ lcs_set_allowed_threads(struct lcs_card *card, unsigned long threads)
327327
spin_unlock_irqrestore(&card->mask_lock, flags);
328328
wake_up(&card->wait_q);
329329
}
330-
static inline int
331-
lcs_threads_running(struct lcs_card *card, unsigned long threads)
330+
static int lcs_threads_running(struct lcs_card *card, unsigned long threads)
332331
{
333332
unsigned long flags;
334333
int rc = 0;
@@ -346,8 +345,7 @@ lcs_wait_for_threads(struct lcs_card *card, unsigned long threads)
346345
lcs_threads_running(card, threads) == 0);
347346
}
348347

349-
static inline int
350-
lcs_set_thread_start_bit(struct lcs_card *card, unsigned long thread)
348+
static int lcs_set_thread_start_bit(struct lcs_card *card, unsigned long thread)
351349
{
352350
unsigned long flags;
353351

@@ -373,8 +371,7 @@ lcs_clear_thread_running_bit(struct lcs_card *card, unsigned long thread)
373371
wake_up(&card->wait_q);
374372
}
375373

376-
static inline int
377-
__lcs_do_run_thread(struct lcs_card *card, unsigned long thread)
374+
static int __lcs_do_run_thread(struct lcs_card *card, unsigned long thread)
378375
{
379376
unsigned long flags;
380377
int rc = 0;
@@ -444,8 +441,7 @@ lcs_setup_card(struct lcs_card *card)
444441
INIT_LIST_HEAD(&card->lancmd_waiters);
445442
}
446443

447-
static inline void
448-
lcs_clear_multicast_list(struct lcs_card *card)
444+
static void lcs_clear_multicast_list(struct lcs_card *card)
449445
{
450446
#ifdef CONFIG_IP_MULTICAST
451447
struct lcs_ipm_list *ipm;
@@ -656,8 +652,7 @@ __lcs_resume_channel(struct lcs_channel *channel)
656652
/**
657653
* Make a buffer ready for processing.
658654
*/
659-
static inline void
660-
__lcs_ready_buffer_bits(struct lcs_channel *channel, int index)
655+
static void __lcs_ready_buffer_bits(struct lcs_channel *channel, int index)
661656
{
662657
int prev, next;
663658

@@ -1169,8 +1164,8 @@ lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev)
11691164
/**
11701165
* function called by net device to handle multicast address relevant things
11711166
*/
1172-
static inline void
1173-
lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
1167+
static void lcs_remove_mc_addresses(struct lcs_card *card,
1168+
struct in_device *in4_dev)
11741169
{
11751170
struct ip_mc_list *im4;
11761171
struct list_head *l;
@@ -1196,8 +1191,9 @@ lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
11961191
spin_unlock_irqrestore(&card->ipm_lock, flags);
11971192
}
11981193

1199-
static inline struct lcs_ipm_list *
1200-
lcs_check_addr_entry(struct lcs_card *card, struct ip_mc_list *im4, char *buf)
1194+
static struct lcs_ipm_list *lcs_check_addr_entry(struct lcs_card *card,
1195+
struct ip_mc_list *im4,
1196+
char *buf)
12011197
{
12021198
struct lcs_ipm_list *tmp, *ipm = NULL;
12031199
struct list_head *l;
@@ -1218,8 +1214,8 @@ lcs_check_addr_entry(struct lcs_card *card, struct ip_mc_list *im4, char *buf)
12181214
return ipm;
12191215
}
12201216

1221-
static inline void
1222-
lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
1217+
static void lcs_set_mc_addresses(struct lcs_card *card,
1218+
struct in_device *in4_dev)
12231219
{
12241220

12251221
struct ip_mc_list *im4;

drivers/s390/net/netiucv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ struct ll_header {
249249
* Compatibility macros for busy handling
250250
* of network devices.
251251
*/
252-
static inline void netiucv_clear_busy(struct net_device *dev)
252+
static void netiucv_clear_busy(struct net_device *dev)
253253
{
254254
struct netiucv_priv *priv = netdev_priv(dev);
255255
clear_bit(0, &priv->tbusy);
256256
netif_wake_queue(dev);
257257
}
258258

259-
static inline int netiucv_test_and_set_busy(struct net_device *dev)
259+
static int netiucv_test_and_set_busy(struct net_device *dev)
260260
{
261261
struct netiucv_priv *priv = netdev_priv(dev);
262262
netif_stop_queue(dev);

drivers/s390/net/qeth_core_main.c

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void qeth_close_dev(struct qeth_card *card)
101101
}
102102
EXPORT_SYMBOL_GPL(qeth_close_dev);
103103

104-
static inline const char *qeth_get_cardname(struct qeth_card *card)
104+
static const char *qeth_get_cardname(struct qeth_card *card)
105105
{
106106
if (card->info.guestlan) {
107107
switch (card->info.type) {
@@ -330,7 +330,7 @@ static struct qeth_qdio_q *qeth_alloc_qdio_queue(void)
330330
return q;
331331
}
332332

333-
static inline int qeth_cq_init(struct qeth_card *card)
333+
static int qeth_cq_init(struct qeth_card *card)
334334
{
335335
int rc;
336336

@@ -352,7 +352,7 @@ static inline int qeth_cq_init(struct qeth_card *card)
352352
return rc;
353353
}
354354

355-
static inline int qeth_alloc_cq(struct qeth_card *card)
355+
static int qeth_alloc_cq(struct qeth_card *card)
356356
{
357357
int rc;
358358

@@ -397,7 +397,7 @@ static inline int qeth_alloc_cq(struct qeth_card *card)
397397
goto out;
398398
}
399399

400-
static inline void qeth_free_cq(struct qeth_card *card)
400+
static void qeth_free_cq(struct qeth_card *card)
401401
{
402402
if (card->qdio.c_q) {
403403
--card->qdio.no_in_queues;
@@ -408,8 +408,9 @@ static inline void qeth_free_cq(struct qeth_card *card)
408408
card->qdio.out_bufstates = NULL;
409409
}
410410

411-
static inline enum iucv_tx_notify qeth_compute_cq_notification(int sbalf15,
412-
int delayed) {
411+
static enum iucv_tx_notify qeth_compute_cq_notification(int sbalf15,
412+
int delayed)
413+
{
413414
enum iucv_tx_notify n;
414415

415416
switch (sbalf15) {
@@ -432,8 +433,8 @@ static inline enum iucv_tx_notify qeth_compute_cq_notification(int sbalf15,
432433
return n;
433434
}
434435

435-
static inline void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q,
436-
int bidx, int forced_cleanup)
436+
static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx,
437+
int forced_cleanup)
437438
{
438439
if (q->card->options.cq != QETH_CQ_ENABLED)
439440
return;
@@ -475,8 +476,9 @@ static inline void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q,
475476
}
476477

477478

478-
static inline void qeth_qdio_handle_aob(struct qeth_card *card,
479-
unsigned long phys_aob_addr) {
479+
static void qeth_qdio_handle_aob(struct qeth_card *card,
480+
unsigned long phys_aob_addr)
481+
{
480482
struct qaob *aob;
481483
struct qeth_qdio_out_buffer *buffer;
482484
enum iucv_tx_notify notification;
@@ -2228,7 +2230,7 @@ static int qeth_cm_setup(struct qeth_card *card)
22282230

22292231
}
22302232

2231-
static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
2233+
static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
22322234
{
22332235
switch (card->info.type) {
22342236
case QETH_CARD_TYPE_UNKNOWN:
@@ -2251,7 +2253,7 @@ static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
22512253
}
22522254
}
22532255

2254-
static inline int qeth_get_mtu_outof_framesize(int framesize)
2256+
static int qeth_get_mtu_outof_framesize(int framesize)
22552257
{
22562258
switch (framesize) {
22572259
case 0x4000:
@@ -2267,7 +2269,7 @@ static inline int qeth_get_mtu_outof_framesize(int framesize)
22672269
}
22682270
}
22692271

2270-
static inline int qeth_mtu_is_valid(struct qeth_card *card, int mtu)
2272+
static int qeth_mtu_is_valid(struct qeth_card *card, int mtu)
22712273
{
22722274
switch (card->info.type) {
22732275
case QETH_CARD_TYPE_OSD:
@@ -2738,8 +2740,8 @@ static void qeth_initialize_working_pool_list(struct qeth_card *card)
27382740
}
27392741
}
27402742

2741-
static inline struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry(
2742-
struct qeth_card *card)
2743+
static struct qeth_buffer_pool_entry *qeth_find_free_buffer_pool_entry(
2744+
struct qeth_card *card)
27432745
{
27442746
struct list_head *plh;
27452747
struct qeth_buffer_pool_entry *entry;
@@ -2870,7 +2872,7 @@ int qeth_init_qdio_queues(struct qeth_card *card)
28702872
}
28712873
EXPORT_SYMBOL_GPL(qeth_init_qdio_queues);
28722874

2873-
static inline __u8 qeth_get_ipa_adp_type(enum qeth_link_types link_type)
2875+
static __u8 qeth_get_ipa_adp_type(enum qeth_link_types link_type)
28742876
{
28752877
switch (link_type) {
28762878
case QETH_LINK_TYPE_HSTR:
@@ -3888,9 +3890,9 @@ int qeth_hdr_chk_and_bounce(struct sk_buff *skb, struct qeth_hdr **hdr, int len)
38883890
}
38893891
EXPORT_SYMBOL_GPL(qeth_hdr_chk_and_bounce);
38903892

3891-
static inline void __qeth_fill_buffer(struct sk_buff *skb,
3892-
struct qeth_qdio_out_buffer *buf,
3893-
bool is_first_elem, unsigned int offset)
3893+
static void __qeth_fill_buffer(struct sk_buff *skb,
3894+
struct qeth_qdio_out_buffer *buf,
3895+
bool is_first_elem, unsigned int offset)
38943896
{
38953897
struct qdio_buffer *buffer = buf->buffer;
38963898
int element = buf->next_element_to_fill;
@@ -3951,10 +3953,10 @@ static inline void __qeth_fill_buffer(struct sk_buff *skb,
39513953
buf->next_element_to_fill = element;
39523954
}
39533955

3954-
static inline int qeth_fill_buffer(struct qeth_qdio_out_q *queue,
3955-
struct qeth_qdio_out_buffer *buf,
3956-
struct sk_buff *skb, struct qeth_hdr *hdr,
3957-
unsigned int offset, int hd_len)
3956+
static int qeth_fill_buffer(struct qeth_qdio_out_q *queue,
3957+
struct qeth_qdio_out_buffer *buf,
3958+
struct sk_buff *skb, struct qeth_hdr *hdr,
3959+
unsigned int offset, int hd_len)
39583960
{
39593961
struct qdio_buffer *buffer;
39603962
int flush_cnt = 0, hdr_len;
@@ -4821,7 +4823,7 @@ int qeth_vm_request_mac(struct qeth_card *card)
48214823
}
48224824
EXPORT_SYMBOL_GPL(qeth_vm_request_mac);
48234825

4824-
static inline int qeth_get_qdio_q_format(struct qeth_card *card)
4826+
static int qeth_get_qdio_q_format(struct qeth_card *card)
48254827
{
48264828
if (card->info.type == QETH_CARD_TYPE_IQD)
48274829
return QDIO_IQDIO_QFMT;
@@ -4886,9 +4888,12 @@ static void qeth_determine_capabilities(struct qeth_card *card)
48864888
return;
48874889
}
48884890

4889-
static inline void qeth_qdio_establish_cq(struct qeth_card *card,
4890-
struct qdio_buffer **in_sbal_ptrs,
4891-
void (**queue_start_poll) (struct ccw_device *, int, unsigned long)) {
4891+
static void qeth_qdio_establish_cq(struct qeth_card *card,
4892+
struct qdio_buffer **in_sbal_ptrs,
4893+
void (**queue_start_poll)
4894+
(struct ccw_device *, int,
4895+
unsigned long))
4896+
{
48924897
int i;
48934898

48944899
if (card->options.cq == QETH_CQ_ENABLED) {
@@ -5180,9 +5185,10 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
51805185
}
51815186
EXPORT_SYMBOL_GPL(qeth_core_hardsetup_card);
51825187

5183-
static inline int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
5184-
struct qdio_buffer_element *element,
5185-
struct sk_buff **pskb, int offset, int *pfrag, int data_len)
5188+
static int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
5189+
struct qdio_buffer_element *element,
5190+
struct sk_buff **pskb, int offset, int *pfrag,
5191+
int data_len)
51865192
{
51875193
struct page *page = virt_to_page(element->addr);
51885194
if (*pskb == NULL) {

drivers/s390/net/qeth_core_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static ssize_t qeth_dev_card_type_show(struct device *dev,
7878

7979
static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
8080

81-
static inline const char *qeth_get_bufsize_str(struct qeth_card *card)
81+
static const char *qeth_get_bufsize_str(struct qeth_card *card)
8282
{
8383
if (card->qdio.in_buf_size == 16384)
8484
return "16k";

drivers/s390/net/qeth_l2_main.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,7 @@ static void qeth_l2_del_all_macs(struct qeth_card *card)
231231
spin_unlock_bh(&card->mclock);
232232
}
233233

234-
static inline u32 qeth_l2_mac_hash(const u8 *addr)
235-
{
236-
return get_unaligned((u32 *)(&addr[2]));
237-
}
238-
239-
static inline int qeth_l2_get_cast_type(struct qeth_card *card,
240-
struct sk_buff *skb)
234+
static int qeth_l2_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
241235
{
242236
if (card->info.type == QETH_CARD_TYPE_OSN)
243237
return RTN_UNSPEC;
@@ -248,8 +242,8 @@ static inline int qeth_l2_get_cast_type(struct qeth_card *card,
248242
return RTN_UNSPEC;
249243
}
250244

251-
static inline void qeth_l2_hdr_csum(struct qeth_card *card,
252-
struct qeth_hdr *hdr, struct sk_buff *skb)
245+
static void qeth_l2_hdr_csum(struct qeth_card *card, struct qeth_hdr *hdr,
246+
struct sk_buff *skb)
253247
{
254248
struct iphdr *iph = ip_hdr(skb);
255249

@@ -606,13 +600,13 @@ static void qeth_promisc_to_bridge(struct qeth_card *card)
606600
* only if there is not in the hash table storage already
607601
*
608602
*/
609-
static void
610-
qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc)
603+
static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha,
604+
u8 is_uc)
611605
{
606+
u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2]));
612607
struct qeth_mac *mac;
613608

614-
hash_for_each_possible(card->mac_htable, mac, hnode,
615-
qeth_l2_mac_hash(ha->addr)) {
609+
hash_for_each_possible(card->mac_htable, mac, hnode, mac_hash) {
616610
if (is_uc == mac->is_uc &&
617611
!memcmp(ha->addr, mac->mac_addr, OSA_ADDR_LEN)) {
618612
mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING;
@@ -629,9 +623,7 @@ qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc)
629623
mac->is_uc = is_uc;
630624
mac->disp_flag = QETH_DISP_ADDR_ADD;
631625

632-
hash_add(card->mac_htable, &mac->hnode,
633-
qeth_l2_mac_hash(mac->mac_addr));
634-
626+
hash_add(card->mac_htable, &mac->hnode, mac_hash);
635627
}
636628

637629
static void qeth_l2_set_rx_mode(struct net_device *dev)

0 commit comments

Comments
 (0)