aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/act2000
diff options
context:
space:
mode:
authorKarsten Keil <keil@b1-systems.de>2009-07-24 12:26:08 -0400
committerKarsten Keil <keil@b1-systems.de>2009-07-25 14:23:05 -0400
commitba2d6ccb1df6ebb2c1b2322518ce7be25c1e3469 (patch)
tree1c454520cbef80d0fdc314104766d2ff0ccd0212 /drivers/isdn/act2000
parent3cad3da3ed9ece03704f7d67e038b8ae710fa312 (diff)
ISDN: ARRAY_SIZE changes
These changes were a direct result of using a semantic patch More information can be found at http://www.emn.fr/x-info/coccinelle/ Modified some of the changes to avoid the extra define. Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu> Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'drivers/isdn/act2000')
-rw-r--r--drivers/isdn/act2000/capi.c3
-rw-r--r--drivers/isdn/act2000/module.c31
2 files changed, 16 insertions, 18 deletions
diff --git a/drivers/isdn/act2000/capi.c b/drivers/isdn/act2000/capi.c
index 946c38cf6f8a..1f0a94906465 100644
--- a/drivers/isdn/act2000/capi.c
+++ b/drivers/isdn/act2000/capi.c
@@ -78,7 +78,6 @@ static actcapi_msgdsc valid_msg[] = {
78#endif 78#endif
79 {{ 0x00, 0x00}, NULL}, 79 {{ 0x00, 0x00}, NULL},
80}; 80};
81#define num_valid_msg (sizeof(valid_msg)/sizeof(actcapi_msgdsc))
82#define num_valid_imsg 27 /* MANUFACTURER_IND */ 81#define num_valid_imsg 27 /* MANUFACTURER_IND */
83 82
84/* 83/*
@@ -1025,7 +1024,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
1025#ifdef DEBUG_DUMP_SKB 1024#ifdef DEBUG_DUMP_SKB
1026 dump_skb(skb); 1025 dump_skb(skb);
1027#endif 1026#endif
1028 for (i = 0; i < num_valid_msg; i++) 1027 for (i = 0; i < ARRAY_SIZE(valid_msg); i++)
1029 if ((msg->hdr.cmd.cmd == valid_msg[i].cmd.cmd) && 1028 if ((msg->hdr.cmd.cmd == valid_msg[i].cmd.cmd) &&
1030 (msg->hdr.cmd.subcmd == valid_msg[i].cmd.subcmd)) { 1029 (msg->hdr.cmd.subcmd == valid_msg[i].cmd.subcmd)) {
1031 descr = valid_msg[i].description; 1030 descr = valid_msg[i].description;
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c
index 8325022e2bed..f774e12bb64d 100644
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -23,7 +23,6 @@ static unsigned short act2000_isa_ports[] =
23 0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380, 23 0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
24 0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60, 24 0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
25}; 25};
26#define ISA_NRPORTS (sizeof(act2000_isa_ports)/sizeof(unsigned short))
27 26
28static act2000_card *cards = (act2000_card *) NULL; 27static act2000_card *cards = (act2000_card *) NULL;
29 28
@@ -686,21 +685,21 @@ act2000_addcard(int bus, int port, int irq, char *id)
686 * This may result in more than one card detected. 685 * This may result in more than one card detected.
687 */ 686 */
688 switch (bus) { 687 switch (bus) {
689 case ACT2000_BUS_ISA: 688 case ACT2000_BUS_ISA:
690 for (i = 0; i < ISA_NRPORTS; i++) 689 for (i = 0; i < ARRAY_SIZE(act2000_isa_ports); i++)
691 if (act2000_isa_detect(act2000_isa_ports[i])) { 690 if (act2000_isa_detect(act2000_isa_ports[i])) {
692 printk(KERN_INFO 691 printk(KERN_INFO "act2000: Detected "
693 "act2000: Detected ISA card at port 0x%x\n", 692 "ISA card at port 0x%x\n",
694 act2000_isa_ports[i]); 693 act2000_isa_ports[i]);
695 act2000_alloccard(bus, act2000_isa_ports[i], irq, id); 694 act2000_alloccard(bus,
696 } 695 act2000_isa_ports[i], irq, id);
697 break; 696 }
698 case ACT2000_BUS_MCA: 697 break;
699 case ACT2000_BUS_PCMCIA: 698 case ACT2000_BUS_MCA:
700 default: 699 case ACT2000_BUS_PCMCIA:
701 printk(KERN_WARNING 700 default:
702 "act2000: addcard: Invalid BUS type %d\n", 701 printk(KERN_WARNING
703 bus); 702 "act2000: addcard: Invalid BUS type %d\n", bus);
704 } 703 }
705 } 704 }
706 if (!cards) 705 if (!cards)