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

[ATM] drivers/atm/horizon.c: stop inlining largish static functions

drivers/atm/horizon.c has unusually large number
of static inline functions - 36.

I looked through them. Most of them seems to be small enough,
but a few are big, others are using udelay or busy loop,
and as such are better not be inlined.

This patch removes "inline" from these static functions
(regardless of number of callsites - gcc nowadays auto-inlines
statics with one callsite).

Size difference for 32bit x86:
text data bss dec hex filename
8201 180 6 8387 20c3 linux-2.6-ALLYES/drivers/atm/horizon.o
7840 180 6 8026 1f5a linux-2.6.inline-ALLYES/drivers/atm/horizon.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Denys Vlasenko and committed by
David S. Miller
2cf83afe ac6f7819

+12 -12
+12 -12
drivers/atm/horizon.c
··· 424 424 return; 425 425 } 426 426 427 - static inline void WAIT_FLUSH_RX_COMPLETE (hrz_dev * dev) { 427 + static void WAIT_FLUSH_RX_COMPLETE (hrz_dev * dev) { 428 428 while (rd_regw (dev, RX_CHANNEL_PORT_OFF) & FLUSH_CHANNEL) 429 429 ; 430 430 return; ··· 435 435 return; 436 436 } 437 437 438 - static inline void WAIT_UPDATE_COMPLETE (hrz_dev * dev) { 438 + static void WAIT_UPDATE_COMPLETE (hrz_dev * dev) { 439 439 while (rd_regw (dev, RX_CHANNEL_PORT_OFF) & RX_CHANNEL_UPDATE_IN_PROGRESS) 440 440 ; 441 441 return; ··· 796 796 797 797 /********** free an skb (as per ATM device driver documentation) **********/ 798 798 799 - static inline void hrz_kfree_skb (struct sk_buff * skb) { 799 + static void hrz_kfree_skb (struct sk_buff * skb) { 800 800 if (ATM_SKB(skb)->vcc->pop) { 801 801 ATM_SKB(skb)->vcc->pop (ATM_SKB(skb)->vcc, skb); 802 802 } else { ··· 1076 1076 1077 1077 /********** handle RX bus master complete events **********/ 1078 1078 1079 - static inline void rx_bus_master_complete_handler (hrz_dev * dev) { 1079 + static void rx_bus_master_complete_handler (hrz_dev * dev) { 1080 1080 if (test_bit (rx_busy, &dev->flags)) { 1081 1081 rx_schedule (dev, 1); 1082 1082 } else { ··· 1089 1089 1090 1090 /********** (queue to) become the next TX thread **********/ 1091 1091 1092 - static inline int tx_hold (hrz_dev * dev) { 1092 + static int tx_hold (hrz_dev * dev) { 1093 1093 PRINTD (DBG_TX, "sleeping at tx lock %p %lu", dev, dev->flags); 1094 1094 wait_event_interruptible(dev->tx_queue, (!test_and_set_bit(tx_busy, &dev->flags))); 1095 1095 PRINTD (DBG_TX, "woken at tx lock %p %lu", dev, dev->flags); ··· 1232 1232 1233 1233 /********** handle TX bus master complete events **********/ 1234 1234 1235 - static inline void tx_bus_master_complete_handler (hrz_dev * dev) { 1235 + static void tx_bus_master_complete_handler (hrz_dev * dev) { 1236 1236 if (test_bit (tx_busy, &dev->flags)) { 1237 1237 tx_schedule (dev, 1); 1238 1238 } else { ··· 1246 1246 /********** move RX Q pointer to next item in circular buffer **********/ 1247 1247 1248 1248 // called only from IRQ sub-handler 1249 - static inline u32 rx_queue_entry_next (hrz_dev * dev) { 1249 + static u32 rx_queue_entry_next (hrz_dev * dev) { 1250 1250 u32 rx_queue_entry; 1251 1251 spin_lock (&dev->mem_lock); 1252 1252 rx_queue_entry = rd_mem (dev, &dev->rx_q_entry->entry); ··· 1270 1270 /********** handle RX data received by device **********/ 1271 1271 1272 1272 // called from IRQ handler 1273 - static inline void rx_data_av_handler (hrz_dev * dev) { 1273 + static void rx_data_av_handler (hrz_dev * dev) { 1274 1274 u32 rx_queue_entry; 1275 1275 u32 rx_queue_entry_flags; 1276 1276 u16 rx_len; ··· 1394 1394 irq_ok = 0; 1395 1395 while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) 1396 1396 & INTERESTING_INTERRUPTS)) { 1397 - // In the interests of fairness, the (inline) handlers below are 1397 + // In the interests of fairness, the handlers below are 1398 1398 // called in sequence and without immediate return to the head of 1399 1399 // the while loop. This is only of issue for slow hosts (or when 1400 1400 // debugging messages are on). Really slow hosts may find a fast ··· 1458 1458 /********** find an idle channel for TX and set it up **********/ 1459 1459 1460 1460 // called with tx_busy set 1461 - static inline short setup_idle_tx_channel (hrz_dev * dev, hrz_vcc * vcc) { 1461 + static short setup_idle_tx_channel (hrz_dev * dev, hrz_vcc * vcc) { 1462 1462 unsigned short idle_channels; 1463 1463 short tx_channel = -1; 1464 1464 unsigned int spin_count; ··· 1777 1777 1778 1778 /********** read the burnt in address **********/ 1779 1779 1780 - static inline void WRITE_IT_WAIT (const hrz_dev *dev, u32 ctrl) 1780 + static void WRITE_IT_WAIT (const hrz_dev *dev, u32 ctrl) 1781 1781 { 1782 1782 wr_regl (dev, CONTROL_0_REG, ctrl); 1783 1783 udelay (5); 1784 1784 } 1785 1785 1786 - static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl) 1786 + static void CLOCK_IT (const hrz_dev *dev, u32 ctrl) 1787 1787 { 1788 1788 // DI must be valid around rising SK edge 1789 1789 WRITE_IT_WAIT(dev, ctrl & ~SEEPROM_SK);