include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / isdn / hisax / l3dss1.c
index 99feae8..cc6ee2d 100644 (file)
@@ -23,6 +23,7 @@
 #include "isdnl3.h"
 #include "l3dss1.h"
 #include <linux/ctype.h>
+#include <linux/slab.h>
 
 extern char *HiSax_getrev(const char *revision);
 static const char *dss1_revision = "$Revision: 2.32.2.3 $";
@@ -2820,9 +2821,6 @@ static struct stateentry downstatelist[] =
         CC_T309, l3dss1_dl_release},
 };
 
-#define DOWNSLLEN \
-       (sizeof(downstatelist) / sizeof(struct stateentry))
-
 static struct stateentry datastatelist[] =
 {
        {ALL_STATES,
@@ -2875,9 +2873,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,
@@ -2888,8 +2883,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[] =
 {
@@ -2903,8 +2896,6 @@ static struct stateentry manstatelist[] =
          DL_RELEASE | INDICATION, l3dss1_dl_release},
 };
 
-#define MANSLLEN \
-        (sizeof(manstatelist) / sizeof(struct stateentry))
 /* *INDENT-ON* */
 
 
@@ -2918,11 +2909,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);
@@ -3097,11 +3088,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) ",
@@ -3156,11 +3147,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);
@@ -3184,11 +3175,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);