Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba2d6ccb authored by Karsten Keil's avatar Karsten Keil
Browse files

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: default avatarStoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
parent 3cad3da3
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ static actcapi_msgdsc valid_msg[] = {
#endif
	{{ 0x00, 0x00}, NULL},
};
#define num_valid_msg (sizeof(valid_msg)/sizeof(actcapi_msgdsc))
#define num_valid_imsg 27 /* MANUFACTURER_IND */

/*
@@ -1025,7 +1024,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
#ifdef DEBUG_DUMP_SKB
	dump_skb(skb);
#endif
	for (i = 0; i < num_valid_msg; i++)
	for (i = 0; i < ARRAY_SIZE(valid_msg); i++)
		if ((msg->hdr.cmd.cmd == valid_msg[i].cmd.cmd) &&
		    (msg->hdr.cmd.subcmd == valid_msg[i].cmd.subcmd)) {
			descr = valid_msg[i].description;
+15 −16
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ static unsigned short act2000_isa_ports[] =
        0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
        0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
};
#define ISA_NRPORTS (sizeof(act2000_isa_ports)/sizeof(unsigned short))

static act2000_card *cards = (act2000_card *) NULL;

@@ -687,20 +686,20 @@ act2000_addcard(int bus, int port, int irq, char *id)
		 */
		switch (bus) {
		case ACT2000_BUS_ISA:
				for (i = 0; i < ISA_NRPORTS; i++)
			for (i = 0; i < ARRAY_SIZE(act2000_isa_ports); i++)
				if (act2000_isa_detect(act2000_isa_ports[i])) {
						printk(KERN_INFO
						       "act2000: Detected ISA card at port 0x%x\n",
					printk(KERN_INFO "act2000: Detected "
						"ISA card at port 0x%x\n",
						act2000_isa_ports[i]);
						act2000_alloccard(bus, act2000_isa_ports[i], irq, id);
					act2000_alloccard(bus,
						act2000_isa_ports[i], irq, id);
				}
			break;
		case ACT2000_BUS_MCA:
		case ACT2000_BUS_PCMCIA:
		default:
			printk(KERN_WARNING
				       "act2000: addcard: Invalid BUS type %d\n",
				       bus);
				"act2000: addcard: Invalid BUS type %d\n", bus);
		}
	}
	if (!cards)
+1 −3
Original line number Diff line number Diff line
@@ -551,9 +551,7 @@ word api_put(APPL * appl, CAPI_MSG * msg)
  dbug(1,dprintf("com=%x",msg->header.command));

  for(j=0;j<MAX_MSG_PARMS+1;j++) msg_parms[j].length = 0;
  for(i=0, ret = _BAD_MSG;
      i<(sizeof(ftable)/sizeof(struct _ftable));
      i++) {
  for(i=0, ret = _BAD_MSG; i < ARRAY_SIZE(ftable); i++) {

    if(ftable[i].command==msg->header.command) {
      /* break loop if the message is correct, otherwise continue scan  */
+1 −2
Original line number Diff line number Diff line
@@ -149,8 +149,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
	diva_os_xdi_adapter_t *diva_current;
	diva_os_xdi_adapter_t *adapter_list[4];
	PISDN_ADAPTER Slave;
	unsigned long bar_length[sizeof(_4bri_bar_length) /
				 sizeof(_4bri_bar_length[0])];
	unsigned long bar_length[ARRAY_SIZE(_4bri_bar_length)];
	int v2 = _4bri_is_rev_2_card(a->CardOrdinal);
	int tasks = _4bri_is_rev_2_bri_card(a->CardOrdinal) ? 1 : MQ_INSTANCE_COUNT;
	int factor = (tasks == 1) ? 1 : 2;
+1 −3
Original line number Diff line number Diff line
@@ -833,8 +833,6 @@ static struct FsmNode fnlist[] __initdata =
};
/* *INDENT-ON* */

#define FNCOUNT (sizeof(fnlist)/sizeof(struct FsmNode))

int __init
CallcNew(void)
{
@@ -842,7 +840,7 @@ CallcNew(void)
	callcfsm.event_count = EVENT_COUNT;
	callcfsm.strEvent = strEvent;
	callcfsm.strState = strState;
	return FsmNew(&callcfsm, fnlist, FNCOUNT);
	return FsmNew(&callcfsm, fnlist, ARRAY_SIZE(fnlist));
}

void
Loading