diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2008-03-30 19:02:43 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-16 20:41:43 -0400 |
commit | a8d06342baab56901bfd70c4f66be382d4b9967d (patch) | |
tree | 379229d047769a28f31e425d84bd69fd56024d21 | |
parent | aa39432326a91a7b819ec3f8d78b05e04b708ce5 (diff) |
sb1000.c: stop inlining largish static functions
drivers/net/sb1000.c has lots of inlined static functions.
Mst of them are used at initialization, wait for some
hardware register to change (wait using yield, sleep etc),
or do slow port-based I/O. Inlining thse "for speed" makes no sense.
This patch removes "inline" from biggest 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
6299 129 0 6428 191c linux-2.6-ALLYES/drivers/net/sb1000.o
5418 129 0 5547 15ab linux-2.6.inline-ALLYES/drivers/net/sb1000.o
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/sb1000.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index 487f9d2ac5b4..829d0ea2709d 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c | |||
@@ -88,31 +88,31 @@ static int sb1000_close(struct net_device *dev); | |||
88 | 88 | ||
89 | 89 | ||
90 | /* SB1000 hardware routines to be used during open/configuration phases */ | 90 | /* SB1000 hardware routines to be used during open/configuration phases */ |
91 | static inline int card_wait_for_busy_clear(const int ioaddr[], | 91 | static int card_wait_for_busy_clear(const int ioaddr[], |
92 | const char* name); | 92 | const char* name); |
93 | static inline int card_wait_for_ready(const int ioaddr[], const char* name, | 93 | static int card_wait_for_ready(const int ioaddr[], const char* name, |
94 | unsigned char in[]); | 94 | unsigned char in[]); |
95 | static int card_send_command(const int ioaddr[], const char* name, | 95 | static int card_send_command(const int ioaddr[], const char* name, |
96 | const unsigned char out[], unsigned char in[]); | 96 | const unsigned char out[], unsigned char in[]); |
97 | 97 | ||
98 | /* SB1000 hardware routines to be used during frame rx interrupt */ | 98 | /* SB1000 hardware routines to be used during frame rx interrupt */ |
99 | static inline int sb1000_wait_for_ready(const int ioaddr[], const char* name); | 99 | static int sb1000_wait_for_ready(const int ioaddr[], const char* name); |
100 | static inline int sb1000_wait_for_ready_clear(const int ioaddr[], | 100 | static int sb1000_wait_for_ready_clear(const int ioaddr[], |
101 | const char* name); | 101 | const char* name); |
102 | static inline void sb1000_send_command(const int ioaddr[], const char* name, | 102 | static void sb1000_send_command(const int ioaddr[], const char* name, |
103 | const unsigned char out[]); | 103 | const unsigned char out[]); |
104 | static inline void sb1000_read_status(const int ioaddr[], unsigned char in[]); | 104 | static void sb1000_read_status(const int ioaddr[], unsigned char in[]); |
105 | static inline void sb1000_issue_read_command(const int ioaddr[], | 105 | static void sb1000_issue_read_command(const int ioaddr[], |
106 | const char* name); | 106 | const char* name); |
107 | 107 | ||
108 | /* SB1000 commands for open/configuration */ | 108 | /* SB1000 commands for open/configuration */ |
109 | static inline int sb1000_reset(const int ioaddr[], const char* name); | 109 | static int sb1000_reset(const int ioaddr[], const char* name); |
110 | static inline int sb1000_check_CRC(const int ioaddr[], const char* name); | 110 | static int sb1000_check_CRC(const int ioaddr[], const char* name); |
111 | static inline int sb1000_start_get_set_command(const int ioaddr[], | 111 | static inline int sb1000_start_get_set_command(const int ioaddr[], |
112 | const char* name); | 112 | const char* name); |
113 | static inline int sb1000_end_get_set_command(const int ioaddr[], | 113 | static int sb1000_end_get_set_command(const int ioaddr[], |
114 | const char* name); | 114 | const char* name); |
115 | static inline int sb1000_activate(const int ioaddr[], const char* name); | 115 | static int sb1000_activate(const int ioaddr[], const char* name); |
116 | static int sb1000_get_firmware_version(const int ioaddr[], | 116 | static int sb1000_get_firmware_version(const int ioaddr[], |
117 | const char* name, unsigned char version[], int do_end); | 117 | const char* name, unsigned char version[], int do_end); |
118 | static int sb1000_get_frequency(const int ioaddr[], const char* name, | 118 | static int sb1000_get_frequency(const int ioaddr[], const char* name, |
@@ -125,8 +125,8 @@ static int sb1000_set_PIDs(const int ioaddr[], const char* name, | |||
125 | const short PID[]); | 125 | const short PID[]); |
126 | 126 | ||
127 | /* SB1000 commands for frame rx interrupt */ | 127 | /* SB1000 commands for frame rx interrupt */ |
128 | static inline int sb1000_rx(struct net_device *dev); | 128 | static int sb1000_rx(struct net_device *dev); |
129 | static inline void sb1000_error_dpc(struct net_device *dev); | 129 | static void sb1000_error_dpc(struct net_device *dev); |
130 | 130 | ||
131 | static const struct pnp_device_id sb1000_pnp_ids[] = { | 131 | static const struct pnp_device_id sb1000_pnp_ids[] = { |
132 | { "GIC1000", 0 }, | 132 | { "GIC1000", 0 }, |
@@ -250,7 +250,7 @@ static struct pnp_driver sb1000_driver = { | |||
250 | static const int TimeOutJiffies = (875 * HZ) / 100; | 250 | static const int TimeOutJiffies = (875 * HZ) / 100; |
251 | 251 | ||
252 | /* Card Wait For Busy Clear (cannot be used during an interrupt) */ | 252 | /* Card Wait For Busy Clear (cannot be used during an interrupt) */ |
253 | static inline int | 253 | static int |
254 | card_wait_for_busy_clear(const int ioaddr[], const char* name) | 254 | card_wait_for_busy_clear(const int ioaddr[], const char* name) |
255 | { | 255 | { |
256 | unsigned char a; | 256 | unsigned char a; |
@@ -274,7 +274,7 @@ card_wait_for_busy_clear(const int ioaddr[], const char* name) | |||
274 | } | 274 | } |
275 | 275 | ||
276 | /* Card Wait For Ready (cannot be used during an interrupt) */ | 276 | /* Card Wait For Ready (cannot be used during an interrupt) */ |
277 | static inline int | 277 | static int |
278 | card_wait_for_ready(const int ioaddr[], const char* name, unsigned char in[]) | 278 | card_wait_for_ready(const int ioaddr[], const char* name, unsigned char in[]) |
279 | { | 279 | { |
280 | unsigned char a; | 280 | unsigned char a; |
@@ -354,7 +354,7 @@ card_send_command(const int ioaddr[], const char* name, | |||
354 | static const int Sb1000TimeOutJiffies = 7 * HZ; | 354 | static const int Sb1000TimeOutJiffies = 7 * HZ; |
355 | 355 | ||
356 | /* Card Wait For Ready (to be used during frame rx) */ | 356 | /* Card Wait For Ready (to be used during frame rx) */ |
357 | static inline int | 357 | static int |
358 | sb1000_wait_for_ready(const int ioaddr[], const char* name) | 358 | sb1000_wait_for_ready(const int ioaddr[], const char* name) |
359 | { | 359 | { |
360 | unsigned long timeout; | 360 | unsigned long timeout; |
@@ -380,7 +380,7 @@ sb1000_wait_for_ready(const int ioaddr[], const char* name) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | /* Card Wait For Ready Clear (to be used during frame rx) */ | 382 | /* Card Wait For Ready Clear (to be used during frame rx) */ |
383 | static inline int | 383 | static int |
384 | sb1000_wait_for_ready_clear(const int ioaddr[], const char* name) | 384 | sb1000_wait_for_ready_clear(const int ioaddr[], const char* name) |
385 | { | 385 | { |
386 | unsigned long timeout; | 386 | unsigned long timeout; |
@@ -405,7 +405,7 @@ sb1000_wait_for_ready_clear(const int ioaddr[], const char* name) | |||
405 | } | 405 | } |
406 | 406 | ||
407 | /* Card Send Command (to be used during frame rx) */ | 407 | /* Card Send Command (to be used during frame rx) */ |
408 | static inline void | 408 | static void |
409 | sb1000_send_command(const int ioaddr[], const char* name, | 409 | sb1000_send_command(const int ioaddr[], const char* name, |
410 | const unsigned char out[]) | 410 | const unsigned char out[]) |
411 | { | 411 | { |
@@ -422,7 +422,7 @@ sb1000_send_command(const int ioaddr[], const char* name, | |||
422 | } | 422 | } |
423 | 423 | ||
424 | /* Card Read Status (to be used during frame rx) */ | 424 | /* Card Read Status (to be used during frame rx) */ |
425 | static inline void | 425 | static void |
426 | sb1000_read_status(const int ioaddr[], unsigned char in[]) | 426 | sb1000_read_status(const int ioaddr[], unsigned char in[]) |
427 | { | 427 | { |
428 | in[1] = inb(ioaddr[0] + 1); | 428 | in[1] = inb(ioaddr[0] + 1); |
@@ -434,7 +434,7 @@ sb1000_read_status(const int ioaddr[], unsigned char in[]) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | /* Issue Read Command (to be used during frame rx) */ | 436 | /* Issue Read Command (to be used during frame rx) */ |
437 | static inline void | 437 | static void |
438 | sb1000_issue_read_command(const int ioaddr[], const char* name) | 438 | sb1000_issue_read_command(const int ioaddr[], const char* name) |
439 | { | 439 | { |
440 | const unsigned char Command0[6] = {0x20, 0x00, 0x00, 0x01, 0x00, 0x00}; | 440 | const unsigned char Command0[6] = {0x20, 0x00, 0x00, 0x01, 0x00, 0x00}; |
@@ -450,7 +450,7 @@ sb1000_issue_read_command(const int ioaddr[], const char* name) | |||
450 | * SB1000 commands for open/configuration | 450 | * SB1000 commands for open/configuration |
451 | */ | 451 | */ |
452 | /* reset SB1000 card */ | 452 | /* reset SB1000 card */ |
453 | static inline int | 453 | static int |
454 | sb1000_reset(const int ioaddr[], const char* name) | 454 | sb1000_reset(const int ioaddr[], const char* name) |
455 | { | 455 | { |
456 | unsigned char st[7]; | 456 | unsigned char st[7]; |
@@ -479,7 +479,7 @@ sb1000_reset(const int ioaddr[], const char* name) | |||
479 | } | 479 | } |
480 | 480 | ||
481 | /* check SB1000 firmware CRC */ | 481 | /* check SB1000 firmware CRC */ |
482 | static inline int | 482 | static int |
483 | sb1000_check_CRC(const int ioaddr[], const char* name) | 483 | sb1000_check_CRC(const int ioaddr[], const char* name) |
484 | { | 484 | { |
485 | unsigned char st[7]; | 485 | unsigned char st[7]; |
@@ -504,7 +504,7 @@ sb1000_start_get_set_command(const int ioaddr[], const char* name) | |||
504 | return card_send_command(ioaddr, name, Command0, st); | 504 | return card_send_command(ioaddr, name, Command0, st); |
505 | } | 505 | } |
506 | 506 | ||
507 | static inline int | 507 | static int |
508 | sb1000_end_get_set_command(const int ioaddr[], const char* name) | 508 | sb1000_end_get_set_command(const int ioaddr[], const char* name) |
509 | { | 509 | { |
510 | unsigned char st[7]; | 510 | unsigned char st[7]; |
@@ -517,7 +517,7 @@ sb1000_end_get_set_command(const int ioaddr[], const char* name) | |||
517 | return card_send_command(ioaddr, name, Command1, st); | 517 | return card_send_command(ioaddr, name, Command1, st); |
518 | } | 518 | } |
519 | 519 | ||
520 | static inline int | 520 | static int |
521 | sb1000_activate(const int ioaddr[], const char* name) | 521 | sb1000_activate(const int ioaddr[], const char* name) |
522 | { | 522 | { |
523 | unsigned char st[7]; | 523 | unsigned char st[7]; |
@@ -694,7 +694,7 @@ sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]) | |||
694 | } | 694 | } |
695 | 695 | ||
696 | 696 | ||
697 | static inline void | 697 | static void |
698 | sb1000_print_status_buffer(const char* name, unsigned char st[], | 698 | sb1000_print_status_buffer(const char* name, unsigned char st[], |
699 | unsigned char buffer[], int size) | 699 | unsigned char buffer[], int size) |
700 | { | 700 | { |
@@ -725,7 +725,7 @@ sb1000_print_status_buffer(const char* name, unsigned char st[], | |||
725 | /* receive a single frame and assemble datagram | 725 | /* receive a single frame and assemble datagram |
726 | * (this is the heart of the interrupt routine) | 726 | * (this is the heart of the interrupt routine) |
727 | */ | 727 | */ |
728 | static inline int | 728 | static int |
729 | sb1000_rx(struct net_device *dev) | 729 | sb1000_rx(struct net_device *dev) |
730 | { | 730 | { |
731 | 731 | ||
@@ -888,7 +888,7 @@ dropped_frame: | |||
888 | return -1; | 888 | return -1; |
889 | } | 889 | } |
890 | 890 | ||
891 | static inline void | 891 | static void |
892 | sb1000_error_dpc(struct net_device *dev) | 892 | sb1000_error_dpc(struct net_device *dev) |
893 | { | 893 | { |
894 | char *name; | 894 | char *name; |