diff options
Diffstat (limited to 'drivers/isdn/hardware/eicon/message.c')
-rw-r--r-- | drivers/isdn/hardware/eicon/message.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c index ab1c112dfb7c..784232a144c8 100644 --- a/drivers/isdn/hardware/eicon/message.c +++ b/drivers/isdn/hardware/eicon/message.c | |||
@@ -6812,7 +6812,7 @@ void nl_ind(PLCI * plci) | |||
6812 | } | 6812 | } |
6813 | if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK)) | 6813 | if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK)) |
6814 | { | 6814 | { |
6815 | if (((T30_INFO *)plci->NL.RBuffer->P)->code < sizeof(fax_info) / sizeof(fax_info[0])) | 6815 | if (((T30_INFO *)plci->NL.RBuffer->P)->code < ARRAY_SIZE(fax_info)) |
6816 | info = fax_info[((T30_INFO *)plci->NL.RBuffer->P)->code]; | 6816 | info = fax_info[((T30_INFO *)plci->NL.RBuffer->P)->code]; |
6817 | else | 6817 | else |
6818 | info = _FAX_PROTOCOL_ERROR; | 6818 | info = _FAX_PROTOCOL_ERROR; |
@@ -9564,7 +9564,7 @@ static struct | |||
9564 | 9564 | ||
9565 | }; | 9565 | }; |
9566 | 9566 | ||
9567 | #define DTMF_DIGIT_MAP_ENTRIES (sizeof(dtmf_digit_map) / sizeof(dtmf_digit_map[0])) | 9567 | #define DTMF_DIGIT_MAP_ENTRIES ARRAY_SIZE(dtmf_digit_map) |
9568 | 9568 | ||
9569 | 9569 | ||
9570 | static void dtmf_enable_receiver (PLCI *plci, byte enable_mask) | 9570 | static void dtmf_enable_receiver (PLCI *plci, byte enable_mask) |
@@ -10069,8 +10069,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI | |||
10069 | PUT_WORD (&result[1], DTMF_INCORRECT_DIGIT); | 10069 | PUT_WORD (&result[1], DTMF_INCORRECT_DIGIT); |
10070 | break; | 10070 | break; |
10071 | } | 10071 | } |
10072 | if (plci->dtmf_send_requests >= | 10072 | if (plci->dtmf_send_requests >= ARRAY_SIZE(plci->dtmf_msg_number_queue)) |
10073 | sizeof(plci->dtmf_msg_number_queue) / sizeof(plci->dtmf_msg_number_queue[0])) | ||
10074 | { | 10073 | { |
10075 | dbug (1, dprintf ("[%06lx] %s,%d: DTMF request overrun", | 10074 | dbug (1, dprintf ("[%06lx] %s,%d: DTMF request overrun", |
10076 | UnMapId (Id), (char *)(FILE_), __LINE__)); | 10075 | UnMapId (Id), (char *)(FILE_), __LINE__)); |
@@ -11018,9 +11017,9 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) | |||
11018 | li_config_table[i].coef_table[j] ^= xconnect_write_prog[n].mask << 4; | 11017 | li_config_table[i].coef_table[j] ^= xconnect_write_prog[n].mask << 4; |
11019 | } | 11018 | } |
11020 | n++; | 11019 | n++; |
11021 | } while ((n < sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0])) | 11020 | } while ((n < ARRAY_SIZE(xconnect_write_prog)) |
11022 | && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE)); | 11021 | && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE)); |
11023 | if (n == sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0])) | 11022 | if (n == ARRAY_SIZE(xconnect_write_prog)) |
11024 | { | 11023 | { |
11025 | do | 11024 | do |
11026 | { | 11025 | { |
@@ -11090,7 +11089,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) | |||
11090 | ch_map[j+1] = (byte)(j+1); | 11089 | ch_map[j+1] = (byte)(j+1); |
11091 | } | 11090 | } |
11092 | } | 11091 | } |
11093 | for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) | 11092 | for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) |
11094 | { | 11093 | { |
11095 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; | 11094 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; |
11096 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; | 11095 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; |
@@ -11140,7 +11139,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) | |||
11140 | w |= MIXER_FEATURE_ENABLE_RX_DATA; | 11139 | w |= MIXER_FEATURE_ENABLE_RX_DATA; |
11141 | *(p++) = (byte) w; | 11140 | *(p++) = (byte) w; |
11142 | *(p++) = (byte)(w >> 8); | 11141 | *(p++) = (byte)(w >> 8); |
11143 | for (n = 0; n < sizeof(mixer_write_prog_pri) / sizeof(mixer_write_prog_pri[0]); n++) | 11142 | for (n = 0; n < ARRAY_SIZE(mixer_write_prog_pri); n++) |
11144 | { | 11143 | { |
11145 | *(p++) = (byte)((plci->li_bchannel_id - 1) | mixer_write_prog_pri[n].line_flags); | 11144 | *(p++) = (byte)((plci->li_bchannel_id - 1) | mixer_write_prog_pri[n].line_flags); |
11146 | for (j = a->li_base; j < a->li_base + MIXER_CHANNELS_PRI; j++) | 11145 | for (j = a->li_base; j < a->li_base + MIXER_CHANNELS_PRI; j++) |
@@ -11196,7 +11195,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) | |||
11196 | ch_map[j+1] = (byte)(j+1); | 11195 | ch_map[j+1] = (byte)(j+1); |
11197 | } | 11196 | } |
11198 | } | 11197 | } |
11199 | for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) | 11198 | for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) |
11200 | { | 11199 | { |
11201 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; | 11200 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; |
11202 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; | 11201 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; |
@@ -13178,7 +13177,7 @@ static void adv_voice_write_coefs (PLCI *plci, word write_command) | |||
13178 | ch_map[j] = (byte)(j + (plci->li_bchannel_id - 1)); | 13177 | ch_map[j] = (byte)(j + (plci->li_bchannel_id - 1)); |
13179 | ch_map[j+1] = (byte)(j + (2 - plci->li_bchannel_id)); | 13178 | ch_map[j+1] = (byte)(j + (2 - plci->li_bchannel_id)); |
13180 | } | 13179 | } |
13181 | for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) | 13180 | for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) |
13182 | { | 13181 | { |
13183 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; | 13182 | i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; |
13184 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; | 13183 | j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; |
@@ -14603,7 +14602,7 @@ static void channel_request_xon (PLCI * plci, byte ch) { | |||
14603 | 14602 | ||
14604 | static void channel_xmit_extended_xon (PLCI * plci) { | 14603 | static void channel_xmit_extended_xon (PLCI * plci) { |
14605 | DIVA_CAPI_ADAPTER * a; | 14604 | DIVA_CAPI_ADAPTER * a; |
14606 | int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]); | 14605 | int max_ch = ARRAY_SIZE(a->ch_flow_control); |
14607 | int i, one_requested = 0; | 14606 | int i, one_requested = 0; |
14608 | 14607 | ||
14609 | if ((!plci) || (!plci->Id) || ((a = plci->adapter) == 0)) { | 14608 | if ((!plci) || (!plci->Id) || ((a = plci->adapter) == 0)) { |
@@ -14628,7 +14627,7 @@ static void channel_xmit_extended_xon (PLCI * plci) { | |||
14628 | Try to xmit next X_ON | 14627 | Try to xmit next X_ON |
14629 | */ | 14628 | */ |
14630 | static int find_channel_with_pending_x_on (DIVA_CAPI_ADAPTER * a, PLCI * plci) { | 14629 | static int find_channel_with_pending_x_on (DIVA_CAPI_ADAPTER * a, PLCI * plci) { |
14631 | int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]); | 14630 | int max_ch = ARRAY_SIZE(a->ch_flow_control); |
14632 | int i; | 14631 | int i; |
14633 | 14632 | ||
14634 | if (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL)) { | 14633 | if (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL)) { |