aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wavelan_cs.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2008-03-31 20:56:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 15:05:57 -0400
commit2aee82de5238625a7664f88d6ebff9de467bb685 (patch)
tree9ec1c7dd8e9897db39ea20094d580f7245e6e047 /drivers/net/wireless/wavelan_cs.c
parent7b463ced635231dd1d4ca6d8b1d93f9353b9dc3a (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.c47
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 */
105static inline void 105static void
106hacr_write_slow(u_long base, 106hacr_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 */
258static inline void 258static void
259mmc_out(u_long base, 259mmc_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 */
278static inline void 278static void
279mmc_write(u_long base, 279mmc_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 */
296static inline u_char 296static u_char
297mmc_in(u_long base, 297mmc_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 */
321static inline void 321static void
322mmc_read(u_long base, 322mmc_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 */
355static inline void 354static void
356fee_wait(u_long base, /* i/o port of the card */ 355fee_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 */
741static inline void wl_roam_gather(struct net_device * dev, 740static 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:
794static inline int WAVELAN_BEACON(unsigned char *data) 793static 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 */
983static inline void 982static void
984wv_82593_reconfig(struct net_device * dev) 983wv_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 */
1236static inline void 1235static void
1237wv_packet_info(u_char * p, /* Packet to dump */ 1236wv_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 */
1275static inline void 1274static void
1276wv_init_info(struct net_device * dev) 1275wv_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 */
1512static inline int 1511static int
1513wv_set_frequency(u_long base, /* i/o port of the card */ 1512wv_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 */
1709static inline int 1708static int
1710wv_frequency_list(u_long base, /* i/o port of the card */ 1709wv_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 */
2762static inline int 2761static int
2763wv_start_of_frame(struct net_device * dev, 2762wv_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 */
2824static inline void 2823static void
2825wv_packet_read(struct net_device * dev, 2824wv_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 */
2925static inline void 2924static void
2926wv_packet_rcv(struct net_device * dev) 2925wv_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 */
3059static inline void 3058static void
3060wv_packet_write(struct net_device * dev, 3059wv_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 */
3183static inline int 3182static int
3184wv_mmc_init(struct net_device * dev) 3183wv_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 */
3702static inline int 3701static int
3703wv_pcmcia_reset(struct net_device * dev) 3702wv_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 */
3867static inline void 3866static void
3868wv_hw_reset(struct net_device * dev) 3867wv_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 */
3898static inline int 3897static int
3899wv_pcmcia_config(struct pcmcia_device * link) 3898wv_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;