diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2008-03-30 19:13:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-16 20:41:44 -0400 |
commit | 7dd73bbcc99b755436d8dc4b412d23e92a685f4d (patch) | |
tree | b202e7e56b9c1dbd497fd90e40e0bc2dda25cc58 /drivers | |
parent | a8d06342baab56901bfd70c4f66be382d4b9967d (diff) |
sb1000.c: make const arrays static
This patch replaces automatic constant arrays a-la
const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
with static ones. Size difference for 32bit x86:
text data bss dec hex filename
5418 129 0 5547 15ab linux-2.6.inline-ALLYES/drivers/net/sb1000.o
5396 129 0 5525 1595 linux-2.6.followup-ALLYES/drivers/net/sb1000.o
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sb1000.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index 829d0ea2709d..5986cec17f19 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c | |||
@@ -437,7 +437,7 @@ sb1000_read_status(const int ioaddr[], unsigned char in[]) | |||
437 | static 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 | static const unsigned char Command0[6] = {0x20, 0x00, 0x00, 0x01, 0x00, 0x00}; |
441 | 441 | ||
442 | sb1000_wait_for_ready_clear(ioaddr, name); | 442 | sb1000_wait_for_ready_clear(ioaddr, name); |
443 | outb(0xa0, ioaddr[0] + 6); | 443 | outb(0xa0, ioaddr[0] + 6); |
@@ -453,9 +453,10 @@ sb1000_issue_read_command(const int ioaddr[], const char* name) | |||
453 | static 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 | static const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00}; | ||
457 | |||
456 | unsigned char st[7]; | 458 | unsigned char st[7]; |
457 | int port, status; | 459 | int port, status; |
458 | const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00}; | ||
459 | 460 | ||
460 | port = ioaddr[1] + 6; | 461 | port = ioaddr[1] + 6; |
461 | outb(0x4, port); | 462 | outb(0x4, port); |
@@ -482,9 +483,10 @@ sb1000_reset(const int ioaddr[], const char* name) | |||
482 | static int | 483 | static int |
483 | sb1000_check_CRC(const int ioaddr[], const char* name) | 484 | sb1000_check_CRC(const int ioaddr[], const char* name) |
484 | { | 485 | { |
486 | static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00}; | ||
487 | |||
485 | unsigned char st[7]; | 488 | unsigned char st[7]; |
486 | int crc, status; | 489 | int crc, status; |
487 | const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00}; | ||
488 | 490 | ||
489 | /* check CRC */ | 491 | /* check CRC */ |
490 | if ((status = card_send_command(ioaddr, name, Command0, st))) | 492 | if ((status = card_send_command(ioaddr, name, Command0, st))) |
@@ -498,8 +500,9 @@ sb1000_check_CRC(const int ioaddr[], const char* name) | |||
498 | static inline int | 500 | static inline int |
499 | sb1000_start_get_set_command(const int ioaddr[], const char* name) | 501 | sb1000_start_get_set_command(const int ioaddr[], const char* name) |
500 | { | 502 | { |
503 | static const unsigned char Command0[6] = {0x80, 0x1b, 0x00, 0x00, 0x00, 0x00}; | ||
504 | |||
501 | unsigned char st[7]; | 505 | unsigned char st[7]; |
502 | const unsigned char Command0[6] = {0x80, 0x1b, 0x00, 0x00, 0x00, 0x00}; | ||
503 | 506 | ||
504 | return card_send_command(ioaddr, name, Command0, st); | 507 | return card_send_command(ioaddr, name, Command0, st); |
505 | } | 508 | } |
@@ -507,10 +510,11 @@ sb1000_start_get_set_command(const int ioaddr[], const char* name) | |||
507 | static int | 510 | static int |
508 | sb1000_end_get_set_command(const int ioaddr[], const char* name) | 511 | sb1000_end_get_set_command(const int ioaddr[], const char* name) |
509 | { | 512 | { |
513 | static const unsigned char Command0[6] = {0x80, 0x1b, 0x02, 0x00, 0x00, 0x00}; | ||
514 | static const unsigned char Command1[6] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; | ||
515 | |||
510 | unsigned char st[7]; | 516 | unsigned char st[7]; |
511 | int status; | 517 | int status; |
512 | const unsigned char Command0[6] = {0x80, 0x1b, 0x02, 0x00, 0x00, 0x00}; | ||
513 | const unsigned char Command1[6] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; | ||
514 | 518 | ||
515 | if ((status = card_send_command(ioaddr, name, Command0, st))) | 519 | if ((status = card_send_command(ioaddr, name, Command0, st))) |
516 | return status; | 520 | return status; |
@@ -520,10 +524,11 @@ sb1000_end_get_set_command(const int ioaddr[], const char* name) | |||
520 | static int | 524 | static int |
521 | sb1000_activate(const int ioaddr[], const char* name) | 525 | sb1000_activate(const int ioaddr[], const char* name) |
522 | { | 526 | { |
527 | static const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00}; | ||
528 | static const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00}; | ||
529 | |||
523 | unsigned char st[7]; | 530 | unsigned char st[7]; |
524 | int status; | 531 | int status; |
525 | const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00}; | ||
526 | const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00}; | ||
527 | 532 | ||
528 | ssleep(1); | 533 | ssleep(1); |
529 | if ((status = card_send_command(ioaddr, name, Command0, st))) | 534 | if ((status = card_send_command(ioaddr, name, Command0, st))) |
@@ -544,9 +549,10 @@ static int | |||
544 | sb1000_get_firmware_version(const int ioaddr[], const char* name, | 549 | sb1000_get_firmware_version(const int ioaddr[], const char* name, |
545 | unsigned char version[], int do_end) | 550 | unsigned char version[], int do_end) |
546 | { | 551 | { |
552 | static const unsigned char Command0[6] = {0x80, 0x23, 0x00, 0x00, 0x00, 0x00}; | ||
553 | |||
547 | unsigned char st[7]; | 554 | unsigned char st[7]; |
548 | int status; | 555 | int status; |
549 | const unsigned char Command0[6] = {0x80, 0x23, 0x00, 0x00, 0x00, 0x00}; | ||
550 | 556 | ||
551 | if ((status = sb1000_start_get_set_command(ioaddr, name))) | 557 | if ((status = sb1000_start_get_set_command(ioaddr, name))) |
552 | return status; | 558 | return status; |
@@ -566,9 +572,10 @@ sb1000_get_firmware_version(const int ioaddr[], const char* name, | |||
566 | static int | 572 | static int |
567 | sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency) | 573 | sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency) |
568 | { | 574 | { |
575 | static const unsigned char Command0[6] = {0x80, 0x44, 0x00, 0x00, 0x00, 0x00}; | ||
576 | |||
569 | unsigned char st[7]; | 577 | unsigned char st[7]; |
570 | int status; | 578 | int status; |
571 | const unsigned char Command0[6] = {0x80, 0x44, 0x00, 0x00, 0x00, 0x00}; | ||
572 | 579 | ||
573 | udelay(1000); | 580 | udelay(1000); |
574 | if ((status = sb1000_start_get_set_command(ioaddr, name))) | 581 | if ((status = sb1000_start_get_set_command(ioaddr, name))) |
@@ -613,12 +620,13 @@ sb1000_set_frequency(const int ioaddr[], const char* name, int frequency) | |||
613 | static int | 620 | static int |
614 | sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[]) | 621 | sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[]) |
615 | { | 622 | { |
623 | static const unsigned char Command0[6] = {0x80, 0x40, 0x00, 0x00, 0x00, 0x00}; | ||
624 | static const unsigned char Command1[6] = {0x80, 0x41, 0x00, 0x00, 0x00, 0x00}; | ||
625 | static const unsigned char Command2[6] = {0x80, 0x42, 0x00, 0x00, 0x00, 0x00}; | ||
626 | static const unsigned char Command3[6] = {0x80, 0x43, 0x00, 0x00, 0x00, 0x00}; | ||
627 | |||
616 | unsigned char st[7]; | 628 | unsigned char st[7]; |
617 | int status; | 629 | int status; |
618 | const unsigned char Command0[6] = {0x80, 0x40, 0x00, 0x00, 0x00, 0x00}; | ||
619 | const unsigned char Command1[6] = {0x80, 0x41, 0x00, 0x00, 0x00, 0x00}; | ||
620 | const unsigned char Command2[6] = {0x80, 0x42, 0x00, 0x00, 0x00, 0x00}; | ||
621 | const unsigned char Command3[6] = {0x80, 0x43, 0x00, 0x00, 0x00, 0x00}; | ||
622 | 630 | ||
623 | udelay(1000); | 631 | udelay(1000); |
624 | if ((status = sb1000_start_get_set_command(ioaddr, name))) | 632 | if ((status = sb1000_start_get_set_command(ioaddr, name))) |
@@ -647,6 +655,8 @@ sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[]) | |||
647 | static int | 655 | static int |
648 | sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]) | 656 | sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]) |
649 | { | 657 | { |
658 | static const unsigned char Command4[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; | ||
659 | |||
650 | unsigned char st[7]; | 660 | unsigned char st[7]; |
651 | short p; | 661 | short p; |
652 | int status; | 662 | int status; |
@@ -654,7 +664,6 @@ sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]) | |||
654 | unsigned char Command1[6] = {0x80, 0x32, 0x00, 0x00, 0x00, 0x00}; | 664 | unsigned char Command1[6] = {0x80, 0x32, 0x00, 0x00, 0x00, 0x00}; |
655 | unsigned char Command2[6] = {0x80, 0x33, 0x00, 0x00, 0x00, 0x00}; | 665 | unsigned char Command2[6] = {0x80, 0x33, 0x00, 0x00, 0x00, 0x00}; |
656 | unsigned char Command3[6] = {0x80, 0x34, 0x00, 0x00, 0x00, 0x00}; | 666 | unsigned char Command3[6] = {0x80, 0x34, 0x00, 0x00, 0x00, 0x00}; |
657 | const unsigned char Command4[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; | ||
658 | 667 | ||
659 | udelay(1000); | 668 | udelay(1000); |
660 | if ((status = sb1000_start_get_set_command(ioaddr, name))) | 669 | if ((status = sb1000_start_get_set_command(ioaddr, name))) |
@@ -891,11 +900,12 @@ dropped_frame: | |||
891 | static void | 900 | static void |
892 | sb1000_error_dpc(struct net_device *dev) | 901 | sb1000_error_dpc(struct net_device *dev) |
893 | { | 902 | { |
903 | static const unsigned char Command0[6] = {0x80, 0x26, 0x00, 0x00, 0x00, 0x00}; | ||
904 | |||
894 | char *name; | 905 | char *name; |
895 | unsigned char st[5]; | 906 | unsigned char st[5]; |
896 | int ioaddr[2]; | 907 | int ioaddr[2]; |
897 | struct sb1000_private *lp = netdev_priv(dev); | 908 | struct sb1000_private *lp = netdev_priv(dev); |
898 | const unsigned char Command0[6] = {0x80, 0x26, 0x00, 0x00, 0x00, 0x00}; | ||
899 | const int ErrorDpcCounterInitialize = 200; | 909 | const int ErrorDpcCounterInitialize = 200; |
900 | 910 | ||
901 | ioaddr[0] = dev->base_addr; | 911 | ioaddr[0] = dev->base_addr; |
@@ -1077,14 +1087,15 @@ sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1077 | /* SB1000 interrupt handler. */ | 1087 | /* SB1000 interrupt handler. */ |
1078 | static irqreturn_t sb1000_interrupt(int irq, void *dev_id) | 1088 | static irqreturn_t sb1000_interrupt(int irq, void *dev_id) |
1079 | { | 1089 | { |
1090 | static const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; | ||
1091 | static const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; | ||
1092 | |||
1080 | char *name; | 1093 | char *name; |
1081 | unsigned char st; | 1094 | unsigned char st; |
1082 | int ioaddr[2]; | 1095 | int ioaddr[2]; |
1083 | struct net_device *dev = dev_id; | 1096 | struct net_device *dev = dev_id; |
1084 | struct sb1000_private *lp = netdev_priv(dev); | 1097 | struct sb1000_private *lp = netdev_priv(dev); |
1085 | 1098 | ||
1086 | const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; | ||
1087 | const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; | ||
1088 | const int MaxRxErrorCount = 6; | 1099 | const int MaxRxErrorCount = 6; |
1089 | 1100 | ||
1090 | ioaddr[0] = dev->base_addr; | 1101 | ioaddr[0] = dev->base_addr; |