aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/l3_1tr6.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/l3_1tr6.c')
-rw-r--r--drivers/isdn/hisax/l3_1tr6.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c
index c5c36eeff261..b0554f80bfb3 100644
--- a/drivers/isdn/hisax/l3_1tr6.c
+++ b/drivers/isdn/hisax/l3_1tr6.c
@@ -698,9 +698,6 @@ static struct stateentry downstl[] =
698 CC_T308_2, l3_1tr6_t308_2}, 698 CC_T308_2, l3_1tr6_t308_2},
699}; 699};
700 700
701#define DOWNSTL_LEN \
702 (sizeof(downstl) / sizeof(struct stateentry))
703
704static struct stateentry datastln1[] = 701static struct stateentry datastln1[] =
705{ 702{
706 {SBIT(0), 703 {SBIT(0),
@@ -735,9 +732,6 @@ static struct stateentry datastln1[] =
735 MT_N1_REL_ACK, l3_1tr6_rel_ack} 732 MT_N1_REL_ACK, l3_1tr6_rel_ack}
736}; 733};
737 734
738#define DATASTLN1_LEN \
739 (sizeof(datastln1) / sizeof(struct stateentry))
740
741static struct stateentry manstatelist[] = 735static struct stateentry manstatelist[] =
742{ 736{
743 {SBIT(2), 737 {SBIT(2),
@@ -746,8 +740,6 @@ static struct stateentry manstatelist[] =
746 DL_RELEASE | INDICATION, l3_1tr6_dl_release}, 740 DL_RELEASE | INDICATION, l3_1tr6_dl_release},
747}; 741};
748 742
749#define MANSLLEN \
750 (sizeof(manstatelist) / sizeof(struct stateentry))
751/* *INDENT-ON* */ 743/* *INDENT-ON* */
752 744
753static void 745static void
@@ -840,11 +832,11 @@ up1tr6(struct PStack *st, int pr, void *arg)
840 mt = MT_N1_INVALID; 832 mt = MT_N1_INVALID;
841 } 833 }
842 } 834 }
843 for (i = 0; i < DATASTLN1_LEN; i++) 835 for (i = 0; i < ARRAY_SIZE(datastln1); i++)
844 if ((mt == datastln1[i].primitive) && 836 if ((mt == datastln1[i].primitive) &&
845 ((1 << proc->state) & datastln1[i].state)) 837 ((1 << proc->state) & datastln1[i].state))
846 break; 838 break;
847 if (i == DATASTLN1_LEN) { 839 if (i == ARRAY_SIZE(datastln1)) {
848 dev_kfree_skb(skb); 840 dev_kfree_skb(skb);
849 if (st->l3.debug & L3_DEB_STATE) { 841 if (st->l3.debug & L3_DEB_STATE) {
850 sprintf(tmp, "up1tr6%sstate %d mt %x unhandled", 842 sprintf(tmp, "up1tr6%sstate %d mt %x unhandled",
@@ -892,11 +884,11 @@ down1tr6(struct PStack *st, int pr, void *arg)
892 proc = arg; 884 proc = arg;
893 } 885 }
894 886
895 for (i = 0; i < DOWNSTL_LEN; i++) 887 for (i = 0; i < ARRAY_SIZE(downstl); i++)
896 if ((pr == downstl[i].primitive) && 888 if ((pr == downstl[i].primitive) &&
897 ((1 << proc->state) & downstl[i].state)) 889 ((1 << proc->state) & downstl[i].state))
898 break; 890 break;
899 if (i == DOWNSTL_LEN) { 891 if (i == ARRAY_SIZE(downstl)) {
900 if (st->l3.debug & L3_DEB_STATE) { 892 if (st->l3.debug & L3_DEB_STATE) {
901 sprintf(tmp, "down1tr6 state %d prim %d unhandled", 893 sprintf(tmp, "down1tr6 state %d prim %d unhandled",
902 proc->state, pr); 894 proc->state, pr);
@@ -922,11 +914,11 @@ man1tr6(struct PStack *st, int pr, void *arg)
922 printk(KERN_ERR "HiSax man1tr6 without proc pr=%04x\n", pr); 914 printk(KERN_ERR "HiSax man1tr6 without proc pr=%04x\n", pr);
923 return; 915 return;
924 } 916 }
925 for (i = 0; i < MANSLLEN; i++) 917 for (i = 0; i < ARRAY_SIZE(manstatelist); i++)
926 if ((pr == manstatelist[i].primitive) && 918 if ((pr == manstatelist[i].primitive) &&
927 ((1 << proc->state) & manstatelist[i].state)) 919 ((1 << proc->state) & manstatelist[i].state))
928 break; 920 break;
929 if (i == MANSLLEN) { 921 if (i == ARRAY_SIZE(manstatelist)) {
930 if (st->l3.debug & L3_DEB_STATE) { 922 if (st->l3.debug & L3_DEB_STATE) {
931 l3_debug(st, "cr %d man1tr6 state %d prim %d unhandled", 923 l3_debug(st, "cr %d man1tr6 state %d prim %d unhandled",
932 proc->callref & 0x7f, proc->state, pr); 924 proc->callref & 0x7f, proc->state, pr);