diff options
author | Karsten Keil <keil@b1-systems.de> | 2009-07-24 12:26:08 -0400 |
---|---|---|
committer | Karsten Keil <keil@b1-systems.de> | 2009-07-25 14:23:05 -0400 |
commit | ba2d6ccb1df6ebb2c1b2322518ce7be25c1e3469 (patch) | |
tree | 1c454520cbef80d0fdc314104766d2ff0ccd0212 /drivers/isdn/hisax/l3dss1.c | |
parent | 3cad3da3ed9ece03704f7d67e038b8ae710fa312 (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/l3dss1.c')
-rw-r--r-- | drivers/isdn/hisax/l3dss1.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index 99feae8b9210..a12fa4d34903 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c | |||
@@ -2820,9 +2820,6 @@ static struct stateentry downstatelist[] = | |||
2820 | CC_T309, l3dss1_dl_release}, | 2820 | CC_T309, l3dss1_dl_release}, |
2821 | }; | 2821 | }; |
2822 | 2822 | ||
2823 | #define DOWNSLLEN \ | ||
2824 | (sizeof(downstatelist) / sizeof(struct stateentry)) | ||
2825 | |||
2826 | static struct stateentry datastatelist[] = | 2823 | static struct stateentry datastatelist[] = |
2827 | { | 2824 | { |
2828 | {ALL_STATES, | 2825 | {ALL_STATES, |
@@ -2875,9 +2872,6 @@ static struct stateentry datastatelist[] = | |||
2875 | MT_RESUME_REJECT, l3dss1_resume_rej}, | 2872 | MT_RESUME_REJECT, l3dss1_resume_rej}, |
2876 | }; | 2873 | }; |
2877 | 2874 | ||
2878 | #define DATASLLEN \ | ||
2879 | (sizeof(datastatelist) / sizeof(struct stateentry)) | ||
2880 | |||
2881 | static struct stateentry globalmes_list[] = | 2875 | static struct stateentry globalmes_list[] = |
2882 | { | 2876 | { |
2883 | {ALL_STATES, | 2877 | {ALL_STATES, |
@@ -2888,8 +2882,6 @@ static struct stateentry globalmes_list[] = | |||
2888 | MT_RESTART_ACKNOWLEDGE, l3dss1_restart_ack}, | 2882 | MT_RESTART_ACKNOWLEDGE, l3dss1_restart_ack}, |
2889 | */ | 2883 | */ |
2890 | }; | 2884 | }; |
2891 | #define GLOBALM_LEN \ | ||
2892 | (sizeof(globalmes_list) / sizeof(struct stateentry)) | ||
2893 | 2885 | ||
2894 | static struct stateentry manstatelist[] = | 2886 | static struct stateentry manstatelist[] = |
2895 | { | 2887 | { |
@@ -2903,8 +2895,6 @@ static struct stateentry manstatelist[] = | |||
2903 | DL_RELEASE | INDICATION, l3dss1_dl_release}, | 2895 | DL_RELEASE | INDICATION, l3dss1_dl_release}, |
2904 | }; | 2896 | }; |
2905 | 2897 | ||
2906 | #define MANSLLEN \ | ||
2907 | (sizeof(manstatelist) / sizeof(struct stateentry)) | ||
2908 | /* *INDENT-ON* */ | 2898 | /* *INDENT-ON* */ |
2909 | 2899 | ||
2910 | 2900 | ||
@@ -2918,11 +2908,11 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb) | |||
2918 | struct l3_process *proc = st->l3.global; | 2908 | struct l3_process *proc = st->l3.global; |
2919 | 2909 | ||
2920 | proc->callref = skb->data[2]; /* cr flag */ | 2910 | proc->callref = skb->data[2]; /* cr flag */ |
2921 | for (i = 0; i < GLOBALM_LEN; i++) | 2911 | for (i = 0; i < ARRAY_SIZE(globalmes_list); i++) |
2922 | if ((mt == globalmes_list[i].primitive) && | 2912 | if ((mt == globalmes_list[i].primitive) && |
2923 | ((1 << proc->state) & globalmes_list[i].state)) | 2913 | ((1 << proc->state) & globalmes_list[i].state)) |
2924 | break; | 2914 | break; |
2925 | if (i == GLOBALM_LEN) { | 2915 | if (i == ARRAY_SIZE(globalmes_list)) { |
2926 | if (st->l3.debug & L3_DEB_STATE) { | 2916 | if (st->l3.debug & L3_DEB_STATE) { |
2927 | l3_debug(st, "dss1 global state %d mt %x unhandled", | 2917 | l3_debug(st, "dss1 global state %d mt %x unhandled", |
2928 | proc->state, mt); | 2918 | proc->state, mt); |
@@ -3097,11 +3087,11 @@ dss1up(struct PStack *st, int pr, void *arg) | |||
3097 | } | 3087 | } |
3098 | if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL) | 3088 | if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL) |
3099 | l3dss1_deliver_display(proc, pr, p); /* Display IE included */ | 3089 | l3dss1_deliver_display(proc, pr, p); /* Display IE included */ |
3100 | for (i = 0; i < DATASLLEN; i++) | 3090 | for (i = 0; i < ARRAY_SIZE(datastatelist); i++) |
3101 | if ((mt == datastatelist[i].primitive) && | 3091 | if ((mt == datastatelist[i].primitive) && |
3102 | ((1 << proc->state) & datastatelist[i].state)) | 3092 | ((1 << proc->state) & datastatelist[i].state)) |
3103 | break; | 3093 | break; |
3104 | if (i == DATASLLEN) { | 3094 | if (i == ARRAY_SIZE(datastatelist)) { |
3105 | if (st->l3.debug & L3_DEB_STATE) { | 3095 | if (st->l3.debug & L3_DEB_STATE) { |
3106 | l3_debug(st, "dss1up%sstate %d mt %#x unhandled", | 3096 | l3_debug(st, "dss1up%sstate %d mt %#x unhandled", |
3107 | (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", | 3097 | (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", |
@@ -3156,11 +3146,11 @@ dss1down(struct PStack *st, int pr, void *arg) | |||
3156 | return; | 3146 | return; |
3157 | } | 3147 | } |
3158 | 3148 | ||
3159 | for (i = 0; i < DOWNSLLEN; i++) | 3149 | for (i = 0; i < ARRAY_SIZE(downstatelist); i++) |
3160 | if ((pr == downstatelist[i].primitive) && | 3150 | if ((pr == downstatelist[i].primitive) && |
3161 | ((1 << proc->state) & downstatelist[i].state)) | 3151 | ((1 << proc->state) & downstatelist[i].state)) |
3162 | break; | 3152 | break; |
3163 | if (i == DOWNSLLEN) { | 3153 | if (i == ARRAY_SIZE(downstatelist)) { |
3164 | if (st->l3.debug & L3_DEB_STATE) { | 3154 | if (st->l3.debug & L3_DEB_STATE) { |
3165 | l3_debug(st, "dss1down state %d prim %#x unhandled", | 3155 | l3_debug(st, "dss1down state %d prim %#x unhandled", |
3166 | proc->state, pr); | 3156 | proc->state, pr); |
@@ -3184,11 +3174,11 @@ dss1man(struct PStack *st, int pr, void *arg) | |||
3184 | printk(KERN_ERR "HiSax dss1man without proc pr=%04x\n", pr); | 3174 | printk(KERN_ERR "HiSax dss1man without proc pr=%04x\n", pr); |
3185 | return; | 3175 | return; |
3186 | } | 3176 | } |
3187 | for (i = 0; i < MANSLLEN; i++) | 3177 | for (i = 0; i < ARRAY_SIZE(manstatelist); i++) |
3188 | if ((pr == manstatelist[i].primitive) && | 3178 | if ((pr == manstatelist[i].primitive) && |
3189 | ((1 << proc->state) & manstatelist[i].state)) | 3179 | ((1 << proc->state) & manstatelist[i].state)) |
3190 | break; | 3180 | break; |
3191 | if (i == MANSLLEN) { | 3181 | if (i == ARRAY_SIZE(manstatelist)) { |
3192 | if (st->l3.debug & L3_DEB_STATE) { | 3182 | if (st->l3.debug & L3_DEB_STATE) { |
3193 | l3_debug(st, "cr %d dss1man state %d prim %#x unhandled", | 3183 | l3_debug(st, "cr %d dss1man state %d prim %#x unhandled", |
3194 | proc->callref & 0x7f, proc->state, pr); | 3184 | proc->callref & 0x7f, proc->state, pr); |