aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/net/wireless/wavelan_cs.c47
-rw-r--r--drivers/net/wireless/wavelan_cs.p.h26
2 files changed, 36 insertions, 37 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;
diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h
index 33dd97094227..628192d7248f 100644
--- a/drivers/net/wireless/wavelan_cs.p.h
+++ b/drivers/net/wireless/wavelan_cs.p.h
@@ -637,7 +637,7 @@ struct net_local
637/* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */ 637/* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */
638static inline u_char /* data */ 638static inline u_char /* data */
639 hasr_read(u_long); /* Read the host interface : base address */ 639 hasr_read(u_long); /* Read the host interface : base address */
640static inline void 640static void
641 hacr_write(u_long, /* Write to host interface : base address */ 641 hacr_write(u_long, /* Write to host interface : base address */
642 u_char), /* data */ 642 u_char), /* data */
643 hacr_write_slow(u_long, 643 hacr_write_slow(u_long,
@@ -651,7 +651,7 @@ static void
651 int, /* Offset in psa */ 651 int, /* Offset in psa */
652 u_char *, /* Buffer in memory */ 652 u_char *, /* Buffer in memory */
653 int); /* Length of buffer */ 653 int); /* Length of buffer */
654static inline void 654static void
655 mmc_out(u_long, /* Write 1 byte to the Modem Manag Control */ 655 mmc_out(u_long, /* Write 1 byte to the Modem Manag Control */
656 u_short, 656 u_short,
657 u_char), 657 u_char),
@@ -659,10 +659,10 @@ static inline void
659 u_char, 659 u_char,
660 u_char *, 660 u_char *,
661 int); 661 int);
662static inline u_char /* Read 1 byte from the MMC */ 662static u_char /* Read 1 byte from the MMC */
663 mmc_in(u_long, 663 mmc_in(u_long,
664 u_short); 664 u_short);
665static inline void 665static void
666 mmc_read(u_long, /* Read n bytes from the MMC */ 666 mmc_read(u_long, /* Read n bytes from the MMC */
667 u_char, 667 u_char,
668 u_char *, 668 u_char *,
@@ -688,10 +688,10 @@ static int
688 int, 688 int,
689 char *, 689 char *,
690 int); 690 int);
691static inline void 691static void
692 wv_82593_reconfig(struct net_device *); /* Reconfigure the controller */ 692 wv_82593_reconfig(struct net_device *); /* Reconfigure the controller */
693/* ------------------- DEBUG & INFO SUBROUTINES ------------------- */ 693/* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
694static inline void 694static void
695 wv_init_info(struct net_device *); /* display startup info */ 695 wv_init_info(struct net_device *); /* display startup info */
696/* ------------------- IOCTL, STATS & RECONFIG ------------------- */ 696/* ------------------- IOCTL, STATS & RECONFIG ------------------- */
697static en_stats * 697static en_stats *
@@ -699,17 +699,17 @@ static en_stats *
699static iw_stats * 699static iw_stats *
700 wavelan_get_wireless_stats(struct net_device *); 700 wavelan_get_wireless_stats(struct net_device *);
701/* ----------------------- PACKET RECEPTION ----------------------- */ 701/* ----------------------- PACKET RECEPTION ----------------------- */
702static inline int 702static int
703 wv_start_of_frame(struct net_device *, /* Seek beggining of current frame */ 703 wv_start_of_frame(struct net_device *, /* Seek beggining of current frame */
704 int, /* end of frame */ 704 int, /* end of frame */
705 int); /* start of buffer */ 705 int); /* start of buffer */
706static inline void 706static void
707 wv_packet_read(struct net_device *, /* Read a packet from a frame */ 707 wv_packet_read(struct net_device *, /* Read a packet from a frame */
708 int, 708 int,
709 int), 709 int),
710 wv_packet_rcv(struct net_device *); /* Read all packets waiting */ 710 wv_packet_rcv(struct net_device *); /* Read all packets waiting */
711/* --------------------- PACKET TRANSMISSION --------------------- */ 711/* --------------------- PACKET TRANSMISSION --------------------- */
712static inline void 712static void
713 wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */ 713 wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */
714 void *, 714 void *,
715 short); 715 short);
@@ -717,20 +717,20 @@ static int
717 wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ 717 wavelan_packet_xmit(struct sk_buff *, /* Send a packet */
718 struct net_device *); 718 struct net_device *);
719/* -------------------- HARDWARE CONFIGURATION -------------------- */ 719/* -------------------- HARDWARE CONFIGURATION -------------------- */
720static inline int 720static int
721 wv_mmc_init(struct net_device *); /* Initialize the modem */ 721 wv_mmc_init(struct net_device *); /* Initialize the modem */
722static int 722static int
723 wv_ru_stop(struct net_device *), /* Stop the i82593 receiver unit */ 723 wv_ru_stop(struct net_device *), /* Stop the i82593 receiver unit */
724 wv_ru_start(struct net_device *); /* Start the i82593 receiver unit */ 724 wv_ru_start(struct net_device *); /* Start the i82593 receiver unit */
725static int 725static int
726 wv_82593_config(struct net_device *); /* Configure the i82593 */ 726 wv_82593_config(struct net_device *); /* Configure the i82593 */
727static inline int 727static int
728 wv_pcmcia_reset(struct net_device *); /* Reset the pcmcia interface */ 728 wv_pcmcia_reset(struct net_device *); /* Reset the pcmcia interface */
729static int 729static int
730 wv_hw_config(struct net_device *); /* Reset & configure the whole hardware */ 730 wv_hw_config(struct net_device *); /* Reset & configure the whole hardware */
731static inline void 731static void
732 wv_hw_reset(struct net_device *); /* Same, + start receiver unit */ 732 wv_hw_reset(struct net_device *); /* Same, + start receiver unit */
733static inline int 733static int
734 wv_pcmcia_config(struct pcmcia_device *); /* Configure the pcmcia interface */ 734 wv_pcmcia_config(struct pcmcia_device *); /* Configure the pcmcia interface */
735static void 735static void
736 wv_pcmcia_release(struct pcmcia_device *);/* Remove a device */ 736 wv_pcmcia_release(struct pcmcia_device *);/* Remove a device */