aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/l3ni1.c
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/hisax/l3ni1.c
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/hisax/l3ni1.c')
-rw-r--r--drivers/isdn/hisax/l3ni1.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c
index f7041d5ba64e..4622d43c7e10 100644
--- a/drivers/isdn/hisax/l3ni1.c
+++ b/drivers/isdn/hisax/l3ni1.c
@@ -2755,9 +2755,6 @@ static struct stateentry downstatelist[] =
2755 CC_TSPID, l3ni1_spid_tout }, 2755 CC_TSPID, l3ni1_spid_tout },
2756}; 2756};
2757 2757
2758#define DOWNSLLEN \
2759 (sizeof(downstatelist) / sizeof(struct stateentry))
2760
2761static struct stateentry datastatelist[] = 2758static struct stateentry datastatelist[] =
2762{ 2759{
2763 {ALL_STATES, 2760 {ALL_STATES,
@@ -2810,9 +2807,6 @@ static struct stateentry datastatelist[] =
2810 MT_RESUME_REJECT, l3ni1_resume_rej}, 2807 MT_RESUME_REJECT, l3ni1_resume_rej},
2811}; 2808};
2812 2809
2813#define DATASLLEN \
2814 (sizeof(datastatelist) / sizeof(struct stateentry))
2815
2816static struct stateentry globalmes_list[] = 2810static struct stateentry globalmes_list[] =
2817{ 2811{
2818 {ALL_STATES, 2812 {ALL_STATES,
@@ -2825,8 +2819,6 @@ static struct stateentry globalmes_list[] =
2825 { SBIT( 0 ), MT_DL_ESTABLISHED, l3ni1_spid_send }, 2819 { SBIT( 0 ), MT_DL_ESTABLISHED, l3ni1_spid_send },
2826 { SBIT( 20 ) | SBIT( 21 ) | SBIT( 22 ), MT_INFORMATION, l3ni1_spid_epid }, 2820 { SBIT( 20 ) | SBIT( 21 ) | SBIT( 22 ), MT_INFORMATION, l3ni1_spid_epid },
2827}; 2821};
2828#define GLOBALM_LEN \
2829 (sizeof(globalmes_list) / sizeof(struct stateentry))
2830 2822
2831static struct stateentry manstatelist[] = 2823static struct stateentry manstatelist[] =
2832{ 2824{
@@ -2840,8 +2832,6 @@ static struct stateentry manstatelist[] =
2840 DL_RELEASE | INDICATION, l3ni1_dl_release}, 2832 DL_RELEASE | INDICATION, l3ni1_dl_release},
2841}; 2833};
2842 2834
2843#define MANSLLEN \
2844 (sizeof(manstatelist) / sizeof(struct stateentry))
2845/* *INDENT-ON* */ 2835/* *INDENT-ON* */
2846 2836
2847 2837
@@ -2858,11 +2848,11 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
2858 proc->callref = skb->data[2]; /* cr flag */ 2848 proc->callref = skb->data[2]; /* cr flag */
2859 else 2849 else
2860 proc->callref = 0; 2850 proc->callref = 0;
2861 for (i = 0; i < GLOBALM_LEN; i++) 2851 for (i = 0; i < ARRAY_SIZE(globalmes_list); i++)
2862 if ((mt == globalmes_list[i].primitive) && 2852 if ((mt == globalmes_list[i].primitive) &&
2863 ((1 << proc->state) & globalmes_list[i].state)) 2853 ((1 << proc->state) & globalmes_list[i].state))
2864 break; 2854 break;
2865 if (i == GLOBALM_LEN) { 2855 if (i == ARRAY_SIZE(globalmes_list)) {
2866 if (st->l3.debug & L3_DEB_STATE) { 2856 if (st->l3.debug & L3_DEB_STATE) {
2867 l3_debug(st, "ni1 global state %d mt %x unhandled", 2857 l3_debug(st, "ni1 global state %d mt %x unhandled",
2868 proc->state, mt); 2858 proc->state, mt);
@@ -3049,11 +3039,11 @@ ni1up(struct PStack *st, int pr, void *arg)
3049 } 3039 }
3050 if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL) 3040 if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL)
3051 l3ni1_deliver_display(proc, pr, p); /* Display IE included */ 3041 l3ni1_deliver_display(proc, pr, p); /* Display IE included */
3052 for (i = 0; i < DATASLLEN; i++) 3042 for (i = 0; i < ARRAY_SIZE(datastatelist); i++)
3053 if ((mt == datastatelist[i].primitive) && 3043 if ((mt == datastatelist[i].primitive) &&
3054 ((1 << proc->state) & datastatelist[i].state)) 3044 ((1 << proc->state) & datastatelist[i].state))
3055 break; 3045 break;
3056 if (i == DATASLLEN) { 3046 if (i == ARRAY_SIZE(datastatelist)) {
3057 if (st->l3.debug & L3_DEB_STATE) { 3047 if (st->l3.debug & L3_DEB_STATE) {
3058 l3_debug(st, "ni1up%sstate %d mt %#x unhandled", 3048 l3_debug(st, "ni1up%sstate %d mt %#x unhandled",
3059 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", 3049 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
@@ -3108,11 +3098,11 @@ ni1down(struct PStack *st, int pr, void *arg)
3108 return; 3098 return;
3109 } 3099 }
3110 3100
3111 for (i = 0; i < DOWNSLLEN; i++) 3101 for (i = 0; i < ARRAY_SIZE(downstatelist); i++)
3112 if ((pr == downstatelist[i].primitive) && 3102 if ((pr == downstatelist[i].primitive) &&
3113 ((1 << proc->state) & downstatelist[i].state)) 3103 ((1 << proc->state) & downstatelist[i].state))
3114 break; 3104 break;
3115 if (i == DOWNSLLEN) { 3105 if (i == ARRAY_SIZE(downstatelist)) {
3116 if (st->l3.debug & L3_DEB_STATE) { 3106 if (st->l3.debug & L3_DEB_STATE) {
3117 l3_debug(st, "ni1down state %d prim %#x unhandled", 3107 l3_debug(st, "ni1down state %d prim %#x unhandled",
3118 proc->state, pr); 3108 proc->state, pr);
@@ -3136,11 +3126,11 @@ ni1man(struct PStack *st, int pr, void *arg)
3136 printk(KERN_ERR "HiSax ni1man without proc pr=%04x\n", pr); 3126 printk(KERN_ERR "HiSax ni1man without proc pr=%04x\n", pr);
3137 return; 3127 return;
3138 } 3128 }
3139 for (i = 0; i < MANSLLEN; i++) 3129 for (i = 0; i < ARRAY_SIZE(manstatelist); i++)
3140 if ((pr == manstatelist[i].primitive) && 3130 if ((pr == manstatelist[i].primitive) &&
3141 ((1 << proc->state) & manstatelist[i].state)) 3131 ((1 << proc->state) & manstatelist[i].state))
3142 break; 3132 break;
3143 if (i == MANSLLEN) { 3133 if (i == ARRAY_SIZE(manstatelist)) {
3144 if (st->l3.debug & L3_DEB_STATE) { 3134 if (st->l3.debug & L3_DEB_STATE) {
3145 l3_debug(st, "cr %d ni1man state %d prim %#x unhandled", 3135 l3_debug(st, "cr %d ni1man state %d prim %#x unhandled",
3146 proc->callref & 0x7f, proc->state, pr); 3136 proc->callref & 0x7f, proc->state, pr);