diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2008-03-31 20:56:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-08 15:05:57 -0400 |
commit | 2aee82de5238625a7664f88d6ebff9de467bb685 (patch) | |
tree | 9ec1c7dd8e9897db39ea20094d580f7245e6e047 /drivers/net/wireless/wavelan_cs.c | |
parent | 7b463ced635231dd1d4ca6d8b1d93f9353b9dc3a (diff) |
wavelan_cs: stop inlining largish static functions
Hi John,
Can you please take a look at this patch?
drivers/net/wireless/wavelan_cs.c has unusually large number
of static inline functions - 27.
I looked through them and 20 of them do not seem to warrant inlining.
Some are really big; others call mdelay(1) or busy-wait for a bit
to be set in a hardware register - it's pointless
to optimize such functions for speed.
This patch removes "inline" from these static function
(regardless of number of callsites - gcc nowadays auto-inlines
statics with one callsite).
Size difference for 32bit x86:
text data bss dec hex filename
17020 372 8 17400 43f8 linux-2.6-ALLYES/drivers/net/wireless/wavelan_cs.o
14032 356 8 14396 383c linux-2.6.inline-ALLYES/drivers/net/wireless/wavelan_cs.o
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--
vda
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wavelan_cs.c')
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 06eea6ab7bf0..baf74015751c 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -102,7 +102,7 @@ hacr_write(u_long base, | |||
102 | * Write to card's Host Adapter Command Register. Include a delay for | 102 | * Write to card's Host Adapter Command Register. Include a delay for |
103 | * those times when it is needed. | 103 | * those times when it is needed. |
104 | */ | 104 | */ |
105 | static inline void | 105 | static void |
106 | hacr_write_slow(u_long base, | 106 | hacr_write_slow(u_long base, |
107 | u_char hacr) | 107 | u_char hacr) |
108 | { | 108 | { |
@@ -255,7 +255,7 @@ update_psa_checksum(struct net_device * dev) | |||
255 | /* | 255 | /* |
256 | * Write 1 byte to the MMC. | 256 | * Write 1 byte to the MMC. |
257 | */ | 257 | */ |
258 | static inline void | 258 | static void |
259 | mmc_out(u_long base, | 259 | mmc_out(u_long base, |
260 | u_short o, | 260 | u_short o, |
261 | u_char d) | 261 | u_char d) |
@@ -275,7 +275,7 @@ mmc_out(u_long base, | |||
275 | * Routine to write bytes to the Modem Management Controller. | 275 | * Routine to write bytes to the Modem Management Controller. |
276 | * We start by the end because it is the way it should be ! | 276 | * We start by the end because it is the way it should be ! |
277 | */ | 277 | */ |
278 | static inline void | 278 | static void |
279 | mmc_write(u_long base, | 279 | mmc_write(u_long base, |
280 | u_char o, | 280 | u_char o, |
281 | u_char * b, | 281 | u_char * b, |
@@ -293,7 +293,7 @@ mmc_write(u_long base, | |||
293 | * Read 1 byte from the MMC. | 293 | * Read 1 byte from the MMC. |
294 | * Optimised version for 1 byte, avoid using memory... | 294 | * Optimised version for 1 byte, avoid using memory... |
295 | */ | 295 | */ |
296 | static inline u_char | 296 | static u_char |
297 | mmc_in(u_long base, | 297 | mmc_in(u_long base, |
298 | u_short o) | 298 | u_short o) |
299 | { | 299 | { |
@@ -318,7 +318,7 @@ mmc_in(u_long base, | |||
318 | * (code has just been moved in the above function) | 318 | * (code has just been moved in the above function) |
319 | * We start by the end because it is the way it should be ! | 319 | * We start by the end because it is the way it should be ! |
320 | */ | 320 | */ |
321 | static inline void | 321 | static void |
322 | mmc_read(u_long base, | 322 | mmc_read(u_long base, |
323 | u_char o, | 323 | u_char o, |
324 | u_char * b, | 324 | u_char * b, |
@@ -350,9 +350,8 @@ mmc_encr(u_long base) /* i/o port of the card */ | |||
350 | /*------------------------------------------------------------------*/ | 350 | /*------------------------------------------------------------------*/ |
351 | /* | 351 | /* |
352 | * Wait for the frequency EEprom to complete a command... | 352 | * Wait for the frequency EEprom to complete a command... |
353 | * I hope this one will be optimally inlined... | ||
354 | */ | 353 | */ |
355 | static inline void | 354 | static void |
356 | fee_wait(u_long base, /* i/o port of the card */ | 355 | fee_wait(u_long base, /* i/o port of the card */ |
357 | int delay, /* Base delay to wait for */ | 356 | int delay, /* Base delay to wait for */ |
358 | int number) /* Number of time to wait */ | 357 | int number) /* Number of time to wait */ |
@@ -738,9 +737,9 @@ static void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp) | |||
738 | } | 737 | } |
739 | 738 | ||
740 | /* Called when a WavePoint beacon is received */ | 739 | /* Called when a WavePoint beacon is received */ |
741 | static inline void wl_roam_gather(struct net_device * dev, | 740 | static void wl_roam_gather(struct net_device * dev, |
742 | u_char * hdr, /* Beacon header */ | 741 | u_char * hdr, /* Beacon header */ |
743 | u_char * stats) /* SNR, Signal quality | 742 | u_char * stats) /* SNR, Signal quality |
744 | of packet */ | 743 | of packet */ |
745 | { | 744 | { |
746 | wavepoint_beacon *beacon= (wavepoint_beacon *)hdr; /* Rcvd. Beacon */ | 745 | wavepoint_beacon *beacon= (wavepoint_beacon *)hdr; /* Rcvd. Beacon */ |
@@ -794,7 +793,7 @@ out: | |||
794 | static inline int WAVELAN_BEACON(unsigned char *data) | 793 | static inline int WAVELAN_BEACON(unsigned char *data) |
795 | { | 794 | { |
796 | wavepoint_beacon *beacon= (wavepoint_beacon *)data; | 795 | wavepoint_beacon *beacon= (wavepoint_beacon *)data; |
797 | static wavepoint_beacon beacon_template={0xaa,0xaa,0x03,0x08,0x00,0x0e,0x20,0x03,0x00}; | 796 | static const wavepoint_beacon beacon_template={0xaa,0xaa,0x03,0x08,0x00,0x0e,0x20,0x03,0x00}; |
798 | 797 | ||
799 | if(memcmp(beacon,&beacon_template,9)==0) | 798 | if(memcmp(beacon,&beacon_template,9)==0) |
800 | return 1; | 799 | return 1; |
@@ -980,7 +979,7 @@ read_ringbuf(struct net_device * dev, | |||
980 | * wavelan_interrupt is not an option...), so you may experience | 979 | * wavelan_interrupt is not an option...), so you may experience |
981 | * some delay sometime... | 980 | * some delay sometime... |
982 | */ | 981 | */ |
983 | static inline void | 982 | static void |
984 | wv_82593_reconfig(struct net_device * dev) | 983 | wv_82593_reconfig(struct net_device * dev) |
985 | { | 984 | { |
986 | net_local * lp = netdev_priv(dev); | 985 | net_local * lp = netdev_priv(dev); |
@@ -1233,7 +1232,7 @@ wv_local_show(struct net_device * dev) | |||
1233 | /* | 1232 | /* |
1234 | * Dump packet header (and content if necessary) on the screen | 1233 | * Dump packet header (and content if necessary) on the screen |
1235 | */ | 1234 | */ |
1236 | static inline void | 1235 | static void |
1237 | wv_packet_info(u_char * p, /* Packet to dump */ | 1236 | wv_packet_info(u_char * p, /* Packet to dump */ |
1238 | int length, /* Length of the packet */ | 1237 | int length, /* Length of the packet */ |
1239 | char * msg1, /* Name of the device */ | 1238 | char * msg1, /* Name of the device */ |
@@ -1272,7 +1271,7 @@ wv_packet_info(u_char * p, /* Packet to dump */ | |||
1272 | * This is the information which is displayed by the driver at startup | 1271 | * This is the information which is displayed by the driver at startup |
1273 | * There is a lot of flag to configure it at your will... | 1272 | * There is a lot of flag to configure it at your will... |
1274 | */ | 1273 | */ |
1275 | static inline void | 1274 | static void |
1276 | wv_init_info(struct net_device * dev) | 1275 | wv_init_info(struct net_device * dev) |
1277 | { | 1276 | { |
1278 | unsigned int base = dev->base_addr; | 1277 | unsigned int base = dev->base_addr; |
@@ -1509,7 +1508,7 @@ wavelan_set_mac_address(struct net_device * dev, | |||
1509 | * Frequency setting (for hardware able of it) | 1508 | * Frequency setting (for hardware able of it) |
1510 | * It's a bit complicated and you don't really want to look into it... | 1509 | * It's a bit complicated and you don't really want to look into it... |
1511 | */ | 1510 | */ |
1512 | static inline int | 1511 | static int |
1513 | wv_set_frequency(u_long base, /* i/o port of the card */ | 1512 | wv_set_frequency(u_long base, /* i/o port of the card */ |
1514 | iw_freq * frequency) | 1513 | iw_freq * frequency) |
1515 | { | 1514 | { |
@@ -1706,7 +1705,7 @@ wv_set_frequency(u_long base, /* i/o port of the card */ | |||
1706 | /* | 1705 | /* |
1707 | * Give the list of available frequencies | 1706 | * Give the list of available frequencies |
1708 | */ | 1707 | */ |
1709 | static inline int | 1708 | static int |
1710 | wv_frequency_list(u_long base, /* i/o port of the card */ | 1709 | wv_frequency_list(u_long base, /* i/o port of the card */ |
1711 | iw_freq * list, /* List of frequency to fill */ | 1710 | iw_freq * list, /* List of frequency to fill */ |
1712 | int max) /* Maximum number of frequencies */ | 1711 | int max) /* Maximum number of frequencies */ |
@@ -2759,7 +2758,7 @@ wavelan_get_wireless_stats(struct net_device * dev) | |||
2759 | * frame pointer and verify that the frame seem correct | 2758 | * frame pointer and verify that the frame seem correct |
2760 | * (called by wv_packet_rcv()) | 2759 | * (called by wv_packet_rcv()) |
2761 | */ | 2760 | */ |
2762 | static inline int | 2761 | static int |
2763 | wv_start_of_frame(struct net_device * dev, | 2762 | wv_start_of_frame(struct net_device * dev, |
2764 | int rfp, /* end of frame */ | 2763 | int rfp, /* end of frame */ |
2765 | int wrap) /* start of buffer */ | 2764 | int wrap) /* start of buffer */ |
@@ -2821,7 +2820,7 @@ wv_start_of_frame(struct net_device * dev, | |||
2821 | * Note: if any errors occur, the packet is "dropped on the floor" | 2820 | * Note: if any errors occur, the packet is "dropped on the floor" |
2822 | * (called by wv_packet_rcv()) | 2821 | * (called by wv_packet_rcv()) |
2823 | */ | 2822 | */ |
2824 | static inline void | 2823 | static void |
2825 | wv_packet_read(struct net_device * dev, | 2824 | wv_packet_read(struct net_device * dev, |
2826 | int fd_p, | 2825 | int fd_p, |
2827 | int sksize) | 2826 | int sksize) |
@@ -2922,7 +2921,7 @@ wv_packet_read(struct net_device * dev, | |||
2922 | * (called by wavelan_interrupt()) | 2921 | * (called by wavelan_interrupt()) |
2923 | * Note : the spinlock is already grabbed for us and irq are disabled. | 2922 | * Note : the spinlock is already grabbed for us and irq are disabled. |
2924 | */ | 2923 | */ |
2925 | static inline void | 2924 | static void |
2926 | wv_packet_rcv(struct net_device * dev) | 2925 | wv_packet_rcv(struct net_device * dev) |
2927 | { | 2926 | { |
2928 | unsigned int base = dev->base_addr; | 2927 | unsigned int base = dev->base_addr; |
@@ -3056,7 +3055,7 @@ wv_packet_rcv(struct net_device * dev) | |||
3056 | * the transmit. | 3055 | * the transmit. |
3057 | * (called in wavelan_packet_xmit()) | 3056 | * (called in wavelan_packet_xmit()) |
3058 | */ | 3057 | */ |
3059 | static inline void | 3058 | static void |
3060 | wv_packet_write(struct net_device * dev, | 3059 | wv_packet_write(struct net_device * dev, |
3061 | void * buf, | 3060 | void * buf, |
3062 | short length) | 3061 | short length) |
@@ -3180,7 +3179,7 @@ wavelan_packet_xmit(struct sk_buff * skb, | |||
3180 | * Routine to initialize the Modem Management Controller. | 3179 | * Routine to initialize the Modem Management Controller. |
3181 | * (called by wv_hw_config()) | 3180 | * (called by wv_hw_config()) |
3182 | */ | 3181 | */ |
3183 | static inline int | 3182 | static int |
3184 | wv_mmc_init(struct net_device * dev) | 3183 | wv_mmc_init(struct net_device * dev) |
3185 | { | 3184 | { |
3186 | unsigned int base = dev->base_addr; | 3185 | unsigned int base = dev->base_addr; |
@@ -3699,7 +3698,7 @@ wv_82593_config(struct net_device * dev) | |||
3699 | * wavelan. | 3698 | * wavelan. |
3700 | * (called by wv_config()) | 3699 | * (called by wv_config()) |
3701 | */ | 3700 | */ |
3702 | static inline int | 3701 | static int |
3703 | wv_pcmcia_reset(struct net_device * dev) | 3702 | wv_pcmcia_reset(struct net_device * dev) |
3704 | { | 3703 | { |
3705 | int i; | 3704 | int i; |
@@ -3864,7 +3863,7 @@ wv_hw_config(struct net_device * dev) | |||
3864 | * 2. Start the LAN controller's receive unit | 3863 | * 2. Start the LAN controller's receive unit |
3865 | * (called by wavelan_event(), wavelan_watchdog() and wavelan_open()) | 3864 | * (called by wavelan_event(), wavelan_watchdog() and wavelan_open()) |
3866 | */ | 3865 | */ |
3867 | static inline void | 3866 | static void |
3868 | wv_hw_reset(struct net_device * dev) | 3867 | wv_hw_reset(struct net_device * dev) |
3869 | { | 3868 | { |
3870 | net_local * lp = netdev_priv(dev); | 3869 | net_local * lp = netdev_priv(dev); |
@@ -3895,7 +3894,7 @@ wv_hw_reset(struct net_device * dev) | |||
3895 | * device available to the system. | 3894 | * device available to the system. |
3896 | * (called by wavelan_event()) | 3895 | * (called by wavelan_event()) |
3897 | */ | 3896 | */ |
3898 | static inline int | 3897 | static int |
3899 | wv_pcmcia_config(struct pcmcia_device * link) | 3898 | wv_pcmcia_config(struct pcmcia_device * link) |
3900 | { | 3899 | { |
3901 | struct net_device * dev = (struct net_device *) link->priv; | 3900 | struct net_device * dev = (struct net_device *) link->priv; |