aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/q931.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/q931.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/q931.c')
-rw-r--r--drivers/isdn/hisax/q931.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c
index aacbf0d14b64..8b853d58e820 100644
--- a/drivers/isdn/hisax/q931.c
+++ b/drivers/isdn/hisax/q931.c
@@ -140,7 +140,7 @@ struct MessageType {
140 } 140 }
141}; 141};
142 142
143#define MTSIZE sizeof(mtlist)/sizeof(struct MessageType) 143#define MTSIZE ARRAY_SIZE(mtlist)
144 144
145static 145static
146struct MessageType mt_n0[] = 146struct MessageType mt_n0[] =
@@ -157,7 +157,7 @@ struct MessageType mt_n0[] =
157 {MT_N0_CLO_ACK, "CLOse ACKnowledge"} 157 {MT_N0_CLO_ACK, "CLOse ACKnowledge"}
158}; 158};
159 159
160#define MT_N0_LEN (sizeof(mt_n0) / sizeof(struct MessageType)) 160#define MT_N0_LEN ARRAY_SIZE(mt_n0)
161 161
162static 162static
163struct MessageType mt_n1[] = 163struct MessageType mt_n1[] =
@@ -194,7 +194,7 @@ struct MessageType mt_n1[] =
194 {MT_N1_STAT, "STATus"} 194 {MT_N1_STAT, "STATus"}
195}; 195};
196 196
197#define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType)) 197#define MT_N1_LEN ARRAY_SIZE(mt_n1)
198 198
199 199
200static int 200static int
@@ -438,7 +438,7 @@ struct CauseValue {
438 }, 438 },
439}; 439};
440 440
441#define CVSIZE sizeof(cvlist)/sizeof(struct CauseValue) 441#define CVSIZE ARRAY_SIZE(cvlist)
442 442
443static 443static
444int 444int
@@ -516,7 +516,7 @@ struct MessageType cause_1tr6[] =
516 {CAUSE_UserInfoDiscarded, "User Info Discarded"} 516 {CAUSE_UserInfoDiscarded, "User Info Discarded"}
517}; 517};
518 518
519static int cause_1tr6_len = (sizeof(cause_1tr6) / sizeof(struct MessageType)); 519static int cause_1tr6_len = ARRAY_SIZE(cause_1tr6);
520 520
521static int 521static int
522prcause_1tr6(char *dest, u_char * p) 522prcause_1tr6(char *dest, u_char * p)
@@ -865,7 +865,7 @@ struct DTag { /* Display tags */
865 { 0x96, "Redirection name" }, 865 { 0x96, "Redirection name" },
866 { 0x9e, "Text" }, 866 { 0x9e, "Text" },
867}; 867};
868#define DTAGSIZE sizeof(dtaglist)/sizeof(struct DTag) 868#define DTAGSIZE ARRAY_SIZE(dtaglist)
869 869
870static int 870static int
871disptext_ni1(char *dest, u_char * p) 871disptext_ni1(char *dest, u_char * p)
@@ -1074,7 +1074,7 @@ struct InformationElement {
1074}; 1074};
1075 1075
1076 1076
1077#define IESIZE sizeof(ielist)/sizeof(struct InformationElement) 1077#define IESIZE ARRAY_SIZE(ielist)
1078 1078
1079static 1079static
1080struct InformationElement ielist_ni1[] = { 1080struct InformationElement ielist_ni1[] = {
@@ -1102,7 +1102,7 @@ struct InformationElement ielist_ni1[] = {
1102}; 1102};
1103 1103
1104 1104
1105#define IESIZE_NI1 sizeof(ielist_ni1)/sizeof(struct InformationElement) 1105#define IESIZE_NI1 ARRAY_SIZE(ielist_ni1)
1106 1106
1107static 1107static
1108struct InformationElement ielist_ni1_cs5[] = { 1108struct InformationElement ielist_ni1_cs5[] = {
@@ -1110,14 +1110,14 @@ struct InformationElement ielist_ni1_cs5[] = {
1110 { 0x2a, "Display text", disptext_ni1 }, 1110 { 0x2a, "Display text", disptext_ni1 },
1111}; 1111};
1112 1112
1113#define IESIZE_NI1_CS5 sizeof(ielist_ni1_cs5)/sizeof(struct InformationElement) 1113#define IESIZE_NI1_CS5 ARRAY_SIZE(ielist_ni1_cs5)
1114 1114
1115static 1115static
1116struct InformationElement ielist_ni1_cs6[] = { 1116struct InformationElement ielist_ni1_cs6[] = {
1117 { 0x7b, "Call appearance", general_ni1 }, 1117 { 0x7b, "Call appearance", general_ni1 },
1118}; 1118};
1119 1119
1120#define IESIZE_NI1_CS6 sizeof(ielist_ni1_cs6)/sizeof(struct InformationElement) 1120#define IESIZE_NI1_CS6 ARRAY_SIZE(ielist_ni1_cs6)
1121 1121
1122static struct InformationElement we_0[] = 1122static struct InformationElement we_0[] =
1123{ 1123{
@@ -1133,7 +1133,7 @@ static struct InformationElement we_0[] =
1133 {WE0_userInfo, "User Info", general} 1133 {WE0_userInfo, "User Info", general}
1134}; 1134};
1135 1135
1136#define WE_0_LEN (sizeof(we_0) / sizeof(struct InformationElement)) 1136#define WE_0_LEN ARRAY_SIZE(we_0)
1137 1137
1138static struct InformationElement we_6[] = 1138static struct InformationElement we_6[] =
1139{ 1139{
@@ -1145,7 +1145,7 @@ static struct InformationElement we_6[] =
1145 {WE6_statusCalled, "Status Called", general}, 1145 {WE6_statusCalled, "Status Called", general},
1146 {WE6_addTransAttr, "Additional Transmission Attributes", general} 1146 {WE6_addTransAttr, "Additional Transmission Attributes", general}
1147}; 1147};
1148#define WE_6_LEN (sizeof(we_6) / sizeof(struct InformationElement)) 1148#define WE_6_LEN ARRAY_SIZE(we_6)
1149 1149
1150int 1150int
1151QuickHex(char *txt, u_char * p, int cnt) 1151QuickHex(char *txt, u_char * p, int cnt)