Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159065
b: refs/heads/master
c: ba2d6cc
h: refs/heads/master
i:
  159063: 1323e84
v: v3
  • Loading branch information
Karsten Keil committed Jul 25, 2009
1 parent eabab27 commit c8a7a64
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 109 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cad3da3ed9ece03704f7d67e038b8ae710fa312
refs/heads/master: ba2d6ccb1df6ebb2c1b2322518ce7be25c1e3469
3 changes: 1 addition & 2 deletions trunk/drivers/isdn/act2000/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/*
Expand Down Expand Up @@ -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;
Expand Down
31 changes: 15 additions & 16 deletions trunk/drivers/isdn/act2000/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -686,21 +685,21 @@ act2000_addcard(int bus, int port, int irq, char *id)
* This may result in more than one card detected.
*/
switch (bus) {
case ACT2000_BUS_ISA:
for (i = 0; i < ISA_NRPORTS; i++)
if (act2000_isa_detect(act2000_isa_ports[i])) {
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);
}
break;
case ACT2000_BUS_MCA:
case ACT2000_BUS_PCMCIA:
default:
printk(KERN_WARNING
"act2000: addcard: Invalid BUS type %d\n",
bus);
case ACT2000_BUS_ISA:
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",
act2000_isa_ports[i]);
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);
}
}
if (!cards)
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/isdn/hardware/eicon/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/isdn/hardware/eicon/os_4bri.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/isdn/hisax/callc.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,16 +833,14 @@ static struct FsmNode fnlist[] __initdata =
};
/* *INDENT-ON* */

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

int __init
CallcNew(void)
{
callcfsm.state_count = STATE_COUNT;
callcfsm.event_count = EVENT_COUNT;
callcfsm.strEvent = strEvent;
callcfsm.strState = strState;
return FsmNew(&callcfsm, fnlist, FNCOUNT);
return FsmNew(&callcfsm, fnlist, ARRAY_SIZE(fnlist));
}

void
Expand Down
12 changes: 3 additions & 9 deletions trunk/drivers/isdn/hisax/isdnl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,6 @@ static struct FsmNode L1SFnList[] __initdata =
{ST_L1_F8, EV_TIMER_DEACT, l1_timer_deact},
};

#define L1S_FN_COUNT (sizeof(L1SFnList)/sizeof(struct FsmNode))

#ifdef HISAX_UINTERFACE
static void
l1_deact_req_u(struct FsmInst *fi, int event, void *arg)
Expand Down Expand Up @@ -706,8 +704,6 @@ static struct FsmNode L1UFnList[] __initdata =
{ST_L1_RESET, EV_TIMER_DEACT, l1_timer_deact},
};

#define L1U_FN_COUNT (sizeof(L1UFnList)/sizeof(struct FsmNode))

#endif

static void
Expand Down Expand Up @@ -754,8 +750,6 @@ static struct FsmNode L1BFnList[] __initdata =
{ST_L1_WAIT_DEACT, EV_TIMER_DEACT, l1b_timer_deact},
};

#define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode))

int __init
Isdnl1New(void)
{
Expand All @@ -765,15 +759,15 @@ Isdnl1New(void)
l1fsm_s.event_count = L1_EVENT_COUNT;
l1fsm_s.strEvent = strL1Event;
l1fsm_s.strState = strL1SState;
retval = FsmNew(&l1fsm_s, L1SFnList, L1S_FN_COUNT);
retval = FsmNew(&l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList));
if (retval)
return retval;

l1fsm_b.state_count = L1B_STATE_COUNT;
l1fsm_b.event_count = L1_EVENT_COUNT;
l1fsm_b.strEvent = strL1Event;
l1fsm_b.strState = strL1BState;
retval = FsmNew(&l1fsm_b, L1BFnList, L1B_FN_COUNT);
retval = FsmNew(&l1fsm_b, L1BFnList, ARRAY_SIZE(L1BFnList));
if (retval) {
FsmFree(&l1fsm_s);
return retval;
Expand All @@ -783,7 +777,7 @@ Isdnl1New(void)
l1fsm_u.event_count = L1_EVENT_COUNT;
l1fsm_u.strEvent = strL1Event;
l1fsm_u.strState = strL1UState;
retval = FsmNew(&l1fsm_u, L1UFnList, L1U_FN_COUNT);
retval = FsmNew(&l1fsm_u, L1UFnList, ARRAY_SIZE(L1UFnList));
if (retval) {
FsmFree(&l1fsm_s);
FsmFree(&l1fsm_b);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/isdn/hisax/isdnl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,8 +1623,6 @@ static struct FsmNode L2FnList[] __initdata =
{ST_L2_8, EV_L1_DEACTIVATE, l2_persistent_da},
};

#define L2_FN_COUNT (sizeof(L2FnList)/sizeof(struct FsmNode))

static void
isdnl2_l1l2(struct PStack *st, int pr, void *arg)
{
Expand Down Expand Up @@ -1836,7 +1834,7 @@ Isdnl2New(void)
l2fsm.event_count = L2_EVENT_COUNT;
l2fsm.strEvent = strL2Event;
l2fsm.strState = strL2State;
return FsmNew(&l2fsm, L2FnList, L2_FN_COUNT);
return FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList));
}

void
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/isdn/hisax/isdnl3.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,6 @@ static struct FsmNode L3FnList[] __initdata =
};
/* *INDENT-ON* */

#define L3_FN_COUNT (sizeof(L3FnList)/sizeof(struct FsmNode))

void
l3_msg(struct PStack *st, int pr, void *arg)
{
Expand Down Expand Up @@ -587,7 +585,7 @@ Isdnl3New(void)
l3fsm.event_count = L3_EVENT_COUNT;
l3fsm.strEvent = strL3Event;
l3fsm.strState = strL3State;
return FsmNew(&l3fsm, L3FnList, L3_FN_COUNT);
return FsmNew(&l3fsm, L3FnList, ARRAY_SIZE(L3FnList));
}

void
Expand Down
20 changes: 6 additions & 14 deletions trunk/drivers/isdn/hisax/l3_1tr6.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,6 @@ static struct stateentry downstl[] =
CC_T308_2, l3_1tr6_t308_2},
};

#define DOWNSTL_LEN \
(sizeof(downstl) / sizeof(struct stateentry))

static struct stateentry datastln1[] =
{
{SBIT(0),
Expand Down Expand Up @@ -735,9 +732,6 @@ static struct stateentry datastln1[] =
MT_N1_REL_ACK, l3_1tr6_rel_ack}
};

#define DATASTLN1_LEN \
(sizeof(datastln1) / sizeof(struct stateentry))

static struct stateentry manstatelist[] =
{
{SBIT(2),
Expand All @@ -746,8 +740,6 @@ static struct stateentry manstatelist[] =
DL_RELEASE | INDICATION, l3_1tr6_dl_release},
};

#define MANSLLEN \
(sizeof(manstatelist) / sizeof(struct stateentry))
/* *INDENT-ON* */

static void
Expand Down Expand Up @@ -840,11 +832,11 @@ up1tr6(struct PStack *st, int pr, void *arg)
mt = MT_N1_INVALID;
}
}
for (i = 0; i < DATASTLN1_LEN; i++)
for (i = 0; i < ARRAY_SIZE(datastln1); i++)
if ((mt == datastln1[i].primitive) &&
((1 << proc->state) & datastln1[i].state))
break;
if (i == DATASTLN1_LEN) {
if (i == ARRAY_SIZE(datastln1)) {
dev_kfree_skb(skb);
if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "up1tr6%sstate %d mt %x unhandled",
Expand Down Expand Up @@ -892,11 +884,11 @@ down1tr6(struct PStack *st, int pr, void *arg)
proc = arg;
}

for (i = 0; i < DOWNSTL_LEN; i++)
for (i = 0; i < ARRAY_SIZE(downstl); i++)
if ((pr == downstl[i].primitive) &&
((1 << proc->state) & downstl[i].state))
break;
if (i == DOWNSTL_LEN) {
if (i == ARRAY_SIZE(downstl)) {
if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "down1tr6 state %d prim %d unhandled",
proc->state, pr);
Expand All @@ -922,11 +914,11 @@ man1tr6(struct PStack *st, int pr, void *arg)
printk(KERN_ERR "HiSax man1tr6 without proc pr=%04x\n", pr);
return;
}
for (i = 0; i < MANSLLEN; i++)
for (i = 0; i < ARRAY_SIZE(manstatelist); i++)
if ((pr == manstatelist[i].primitive) &&
((1 << proc->state) & manstatelist[i].state))
break;
if (i == MANSLLEN) {
if (i == ARRAY_SIZE(manstatelist)) {
if (st->l3.debug & L3_DEB_STATE) {
l3_debug(st, "cr %d man1tr6 state %d prim %d unhandled",
proc->callref & 0x7f, proc->state, pr);
Expand Down
26 changes: 8 additions & 18 deletions trunk/drivers/isdn/hisax/l3dss1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2820,9 +2820,6 @@ static struct stateentry downstatelist[] =
CC_T309, l3dss1_dl_release},
};

#define DOWNSLLEN \
(sizeof(downstatelist) / sizeof(struct stateentry))

static struct stateentry datastatelist[] =
{
{ALL_STATES,
Expand Down Expand Up @@ -2875,9 +2872,6 @@ static struct stateentry datastatelist[] =
MT_RESUME_REJECT, l3dss1_resume_rej},
};

#define DATASLLEN \
(sizeof(datastatelist) / sizeof(struct stateentry))

static struct stateentry globalmes_list[] =
{
{ALL_STATES,
Expand All @@ -2888,8 +2882,6 @@ static struct stateentry globalmes_list[] =
MT_RESTART_ACKNOWLEDGE, l3dss1_restart_ack},
*/
};
#define GLOBALM_LEN \
(sizeof(globalmes_list) / sizeof(struct stateentry))

static struct stateentry manstatelist[] =
{
Expand All @@ -2903,8 +2895,6 @@ static struct stateentry manstatelist[] =
DL_RELEASE | INDICATION, l3dss1_dl_release},
};

#define MANSLLEN \
(sizeof(manstatelist) / sizeof(struct stateentry))
/* *INDENT-ON* */


Expand All @@ -2918,11 +2908,11 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
struct l3_process *proc = st->l3.global;

proc->callref = skb->data[2]; /* cr flag */
for (i = 0; i < GLOBALM_LEN; i++)
for (i = 0; i < ARRAY_SIZE(globalmes_list); i++)
if ((mt == globalmes_list[i].primitive) &&
((1 << proc->state) & globalmes_list[i].state))
break;
if (i == GLOBALM_LEN) {
if (i == ARRAY_SIZE(globalmes_list)) {
if (st->l3.debug & L3_DEB_STATE) {
l3_debug(st, "dss1 global state %d mt %x unhandled",
proc->state, mt);
Expand Down Expand Up @@ -3097,11 +3087,11 @@ dss1up(struct PStack *st, int pr, void *arg)
}
if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL)
l3dss1_deliver_display(proc, pr, p); /* Display IE included */
for (i = 0; i < DATASLLEN; i++)
for (i = 0; i < ARRAY_SIZE(datastatelist); i++)
if ((mt == datastatelist[i].primitive) &&
((1 << proc->state) & datastatelist[i].state))
break;
if (i == DATASLLEN) {
if (i == ARRAY_SIZE(datastatelist)) {
if (st->l3.debug & L3_DEB_STATE) {
l3_debug(st, "dss1up%sstate %d mt %#x unhandled",
(pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
Expand Down Expand Up @@ -3156,11 +3146,11 @@ dss1down(struct PStack *st, int pr, void *arg)
return;
}

for (i = 0; i < DOWNSLLEN; i++)
for (i = 0; i < ARRAY_SIZE(downstatelist); i++)
if ((pr == downstatelist[i].primitive) &&
((1 << proc->state) & downstatelist[i].state))
break;
if (i == DOWNSLLEN) {
if (i == ARRAY_SIZE(downstatelist)) {
if (st->l3.debug & L3_DEB_STATE) {
l3_debug(st, "dss1down state %d prim %#x unhandled",
proc->state, pr);
Expand All @@ -3184,11 +3174,11 @@ dss1man(struct PStack *st, int pr, void *arg)
printk(KERN_ERR "HiSax dss1man without proc pr=%04x\n", pr);
return;
}
for (i = 0; i < MANSLLEN; i++)
for (i = 0; i < ARRAY_SIZE(manstatelist); i++)
if ((pr == manstatelist[i].primitive) &&
((1 << proc->state) & manstatelist[i].state))
break;
if (i == MANSLLEN) {
if (i == ARRAY_SIZE(manstatelist)) {
if (st->l3.debug & L3_DEB_STATE) {
l3_debug(st, "cr %d dss1man state %d prim %#x unhandled",
proc->callref & 0x7f, proc->state, pr);
Expand Down
Loading

0 comments on commit c8a7a64

Please sign in to comment.