diff options
author | Dragos Foianu <dragos.foianu@gmail.com> | 2013-07-17 07:25:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-19 20:34:40 -0400 |
commit | aafee33423e78e86becda986b24a5819a7d16ff7 (patch) | |
tree | f5a2678fbca5fc4a93d8f382343ee64691b07216 /net/irda/irttp.c | |
parent | ecb2cf1a6b63825a258ff4fe0d7f3070fbe4676b (diff) |
net/irda: fixed style issues in irttp
Applied error fixes suggested by checpatch.pl
Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irttp.c')
-rw-r--r-- | net/irda/irttp.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index ae43c62f9045..85372cfa7b9f 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -75,7 +75,7 @@ static pi_minor_info_t pi_minor_call_table[] = { | |||
75 | { NULL, 0 }, /* 0x00 */ | 75 | { NULL, 0 }, /* 0x00 */ |
76 | { irttp_param_max_sdu_size, PV_INTEGER | PV_BIG_ENDIAN } /* 0x01 */ | 76 | { irttp_param_max_sdu_size, PV_INTEGER | PV_BIG_ENDIAN } /* 0x01 */ |
77 | }; | 77 | }; |
78 | static pi_major_info_t pi_major_call_table[] = {{ pi_minor_call_table, 2 }}; | 78 | static pi_major_info_t pi_major_call_table[] = { { pi_minor_call_table, 2 } }; |
79 | static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 }; | 79 | static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 }; |
80 | 80 | ||
81 | /************************ GLOBAL PROCEDURES ************************/ | 81 | /************************ GLOBAL PROCEDURES ************************/ |
@@ -205,7 +205,7 @@ static void irttp_todo_expired(unsigned long data) | |||
205 | */ | 205 | */ |
206 | static void irttp_flush_queues(struct tsap_cb *self) | 206 | static void irttp_flush_queues(struct tsap_cb *self) |
207 | { | 207 | { |
208 | struct sk_buff* skb; | 208 | struct sk_buff *skb; |
209 | 209 | ||
210 | IRDA_DEBUG(4, "%s()\n", __func__); | 210 | IRDA_DEBUG(4, "%s()\n", __func__); |
211 | 211 | ||
@@ -400,7 +400,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) | |||
400 | /* The IrLMP spec (IrLMP 1.1 p10) says that we have the right to | 400 | /* The IrLMP spec (IrLMP 1.1 p10) says that we have the right to |
401 | * use only 0x01-0x6F. Of course, we can use LSAP_ANY as well. | 401 | * use only 0x01-0x6F. Of course, we can use LSAP_ANY as well. |
402 | * JeanII */ | 402 | * JeanII */ |
403 | if((stsap_sel != LSAP_ANY) && | 403 | if ((stsap_sel != LSAP_ANY) && |
404 | ((stsap_sel < 0x01) || (stsap_sel >= 0x70))) { | 404 | ((stsap_sel < 0x01) || (stsap_sel >= 0x70))) { |
405 | IRDA_DEBUG(0, "%s(), invalid tsap!\n", __func__); | 405 | IRDA_DEBUG(0, "%s(), invalid tsap!\n", __func__); |
406 | return NULL; | 406 | return NULL; |
@@ -427,7 +427,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) | |||
427 | ttp_notify.data_indication = irttp_data_indication; | 427 | ttp_notify.data_indication = irttp_data_indication; |
428 | ttp_notify.udata_indication = irttp_udata_indication; | 428 | ttp_notify.udata_indication = irttp_udata_indication; |
429 | ttp_notify.flow_indication = irttp_flow_indication; | 429 | ttp_notify.flow_indication = irttp_flow_indication; |
430 | if(notify->status_indication != NULL) | 430 | if (notify->status_indication != NULL) |
431 | ttp_notify.status_indication = irttp_status_indication; | 431 | ttp_notify.status_indication = irttp_status_indication; |
432 | ttp_notify.instance = self; | 432 | ttp_notify.instance = self; |
433 | strncpy(ttp_notify.name, notify->name, NOTIFY_MAX_NAME); | 433 | strncpy(ttp_notify.name, notify->name, NOTIFY_MAX_NAME); |
@@ -639,8 +639,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) | |||
639 | */ | 639 | */ |
640 | if ((self->tx_max_sdu_size != 0) && | 640 | if ((self->tx_max_sdu_size != 0) && |
641 | (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && | 641 | (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && |
642 | (skb->len > self->tx_max_sdu_size)) | 642 | (skb->len > self->tx_max_sdu_size)) { |
643 | { | ||
644 | IRDA_ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n", | 643 | IRDA_ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n", |
645 | __func__); | 644 | __func__); |
646 | ret = -EMSGSIZE; | 645 | ret = -EMSGSIZE; |
@@ -733,8 +732,7 @@ static void irttp_run_tx_queue(struct tsap_cb *self) | |||
733 | * poll us through irttp_flow_indication() - Jean II */ | 732 | * poll us through irttp_flow_indication() - Jean II */ |
734 | while ((self->send_credit > 0) && | 733 | while ((self->send_credit > 0) && |
735 | (!irlmp_lap_tx_queue_full(self->lsap)) && | 734 | (!irlmp_lap_tx_queue_full(self->lsap)) && |
736 | (skb = skb_dequeue(&self->tx_queue))) | 735 | (skb = skb_dequeue(&self->tx_queue))) { |
737 | { | ||
738 | /* | 736 | /* |
739 | * Since we can transmit and receive frames concurrently, | 737 | * Since we can transmit and receive frames concurrently, |
740 | * the code below is a critical region and we must assure that | 738 | * the code below is a critical region and we must assure that |
@@ -798,8 +796,7 @@ static void irttp_run_tx_queue(struct tsap_cb *self) | |||
798 | * where we can spend a bit of time doing stuff. - Jean II */ | 796 | * where we can spend a bit of time doing stuff. - Jean II */ |
799 | if ((self->tx_sdu_busy) && | 797 | if ((self->tx_sdu_busy) && |
800 | (skb_queue_len(&self->tx_queue) < TTP_TX_LOW_THRESHOLD) && | 798 | (skb_queue_len(&self->tx_queue) < TTP_TX_LOW_THRESHOLD) && |
801 | (!self->close_pend)) | 799 | (!self->close_pend)) { |
802 | { | ||
803 | if (self->notify.flow_indication) | 800 | if (self->notify.flow_indication) |
804 | self->notify.flow_indication(self->notify.instance, | 801 | self->notify.flow_indication(self->notify.instance, |
805 | self, FLOW_START); | 802 | self, FLOW_START); |
@@ -892,7 +889,7 @@ static int irttp_udata_indication(void *instance, void *sap, | |||
892 | /* Just pass data to layer above */ | 889 | /* Just pass data to layer above */ |
893 | if (self->notify.udata_indication) { | 890 | if (self->notify.udata_indication) { |
894 | err = self->notify.udata_indication(self->notify.instance, | 891 | err = self->notify.udata_indication(self->notify.instance, |
895 | self,skb); | 892 | self, skb); |
896 | /* Same comment as in irttp_do_data_indication() */ | 893 | /* Same comment as in irttp_do_data_indication() */ |
897 | if (!err) | 894 | if (!err) |
898 | return 0; | 895 | return 0; |
@@ -1057,7 +1054,7 @@ static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
1057 | * to do that. Jean II */ | 1054 | * to do that. Jean II */ |
1058 | 1055 | ||
1059 | /* If we need to send disconnect. try to do it now */ | 1056 | /* If we need to send disconnect. try to do it now */ |
1060 | if(self->disconnect_pend) | 1057 | if (self->disconnect_pend) |
1061 | irttp_start_todo_timer(self, 0); | 1058 | irttp_start_todo_timer(self, 0); |
1062 | } | 1059 | } |
1063 | 1060 | ||
@@ -1116,7 +1113,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1116 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;); | 1113 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;); |
1117 | 1114 | ||
1118 | if (self->connected) { | 1115 | if (self->connected) { |
1119 | if(userdata) | 1116 | if (userdata) |
1120 | dev_kfree_skb(userdata); | 1117 | dev_kfree_skb(userdata); |
1121 | return -EISCONN; | 1118 | return -EISCONN; |
1122 | } | 1119 | } |
@@ -1137,7 +1134,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1137 | * headers | 1134 | * headers |
1138 | */ | 1135 | */ |
1139 | IRDA_ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, | 1136 | IRDA_ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, |
1140 | { dev_kfree_skb(userdata); return -1; } ); | 1137 | { dev_kfree_skb(userdata); return -1; }); |
1141 | } | 1138 | } |
1142 | 1139 | ||
1143 | /* Initialize connection parameters */ | 1140 | /* Initialize connection parameters */ |
@@ -1157,7 +1154,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1157 | * Give away max 127 credits for now | 1154 | * Give away max 127 credits for now |
1158 | */ | 1155 | */ |
1159 | if (n > 127) { | 1156 | if (n > 127) { |
1160 | self->avail_credit=n-127; | 1157 | self->avail_credit = n - 127; |
1161 | n = 127; | 1158 | n = 127; |
1162 | } | 1159 | } |
1163 | 1160 | ||
@@ -1166,10 +1163,10 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1166 | /* SAR enabled? */ | 1163 | /* SAR enabled? */ |
1167 | if (max_sdu_size > 0) { | 1164 | if (max_sdu_size > 0) { |
1168 | IRDA_ASSERT(skb_headroom(tx_skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER), | 1165 | IRDA_ASSERT(skb_headroom(tx_skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER), |
1169 | { dev_kfree_skb(tx_skb); return -1; } ); | 1166 | { dev_kfree_skb(tx_skb); return -1; }); |
1170 | 1167 | ||
1171 | /* Insert SAR parameters */ | 1168 | /* Insert SAR parameters */ |
1172 | frame = skb_push(tx_skb, TTP_HEADER+TTP_SAR_HEADER); | 1169 | frame = skb_push(tx_skb, TTP_HEADER + TTP_SAR_HEADER); |
1173 | 1170 | ||
1174 | frame[0] = TTP_PARAMETERS | n; | 1171 | frame[0] = TTP_PARAMETERS | n; |
1175 | frame[1] = 0x04; /* Length */ | 1172 | frame[1] = 0x04; /* Length */ |
@@ -1386,7 +1383,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, | |||
1386 | * headers | 1383 | * headers |
1387 | */ | 1384 | */ |
1388 | IRDA_ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, | 1385 | IRDA_ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, |
1389 | { dev_kfree_skb(userdata); return -1; } ); | 1386 | { dev_kfree_skb(userdata); return -1; }); |
1390 | } | 1387 | } |
1391 | 1388 | ||
1392 | self->avail_credit = 0; | 1389 | self->avail_credit = 0; |
@@ -1409,10 +1406,10 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, | |||
1409 | /* SAR enabled? */ | 1406 | /* SAR enabled? */ |
1410 | if (max_sdu_size > 0) { | 1407 | if (max_sdu_size > 0) { |
1411 | IRDA_ASSERT(skb_headroom(tx_skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER), | 1408 | IRDA_ASSERT(skb_headroom(tx_skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER), |
1412 | { dev_kfree_skb(tx_skb); return -1; } ); | 1409 | { dev_kfree_skb(tx_skb); return -1; }); |
1413 | 1410 | ||
1414 | /* Insert TTP header with SAR parameters */ | 1411 | /* Insert TTP header with SAR parameters */ |
1415 | frame = skb_push(tx_skb, TTP_HEADER+TTP_SAR_HEADER); | 1412 | frame = skb_push(tx_skb, TTP_HEADER + TTP_SAR_HEADER); |
1416 | 1413 | ||
1417 | frame[0] = TTP_PARAMETERS | n; | 1414 | frame[0] = TTP_PARAMETERS | n; |
1418 | frame[1] = 0x04; /* Length */ | 1415 | frame[1] = 0x04; /* Length */ |
@@ -1522,7 +1519,7 @@ int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata, | |||
1522 | * function may be called from various context, like user, timer | 1519 | * function may be called from various context, like user, timer |
1523 | * for following a disconnect_indication() (i.e. net_bh). | 1520 | * for following a disconnect_indication() (i.e. net_bh). |
1524 | * Jean II */ | 1521 | * Jean II */ |
1525 | if(test_and_set_bit(0, &self->disconnect_pend)) { | 1522 | if (test_and_set_bit(0, &self->disconnect_pend)) { |
1526 | IRDA_DEBUG(0, "%s(), disconnect already pending\n", | 1523 | IRDA_DEBUG(0, "%s(), disconnect already pending\n", |
1527 | __func__); | 1524 | __func__); |
1528 | if (userdata) | 1525 | if (userdata) |
@@ -1627,7 +1624,7 @@ static void irttp_disconnect_indication(void *instance, void *sap, | |||
1627 | * Jean II */ | 1624 | * Jean II */ |
1628 | 1625 | ||
1629 | /* No need to notify the client if has already tried to disconnect */ | 1626 | /* No need to notify the client if has already tried to disconnect */ |
1630 | if(self->notify.disconnect_indication) | 1627 | if (self->notify.disconnect_indication) |
1631 | self->notify.disconnect_indication(self->notify.instance, self, | 1628 | self->notify.disconnect_indication(self->notify.instance, self, |
1632 | reason, skb); | 1629 | reason, skb); |
1633 | else | 1630 | else |
@@ -1738,8 +1735,7 @@ static void irttp_run_rx_queue(struct tsap_cb *self) | |||
1738 | * This is the last fragment, so time to reassemble! | 1735 | * This is the last fragment, so time to reassemble! |
1739 | */ | 1736 | */ |
1740 | if ((self->rx_sdu_size <= self->rx_max_sdu_size) || | 1737 | if ((self->rx_sdu_size <= self->rx_max_sdu_size) || |
1741 | (self->rx_max_sdu_size == TTP_SAR_UNBOUND)) | 1738 | (self->rx_max_sdu_size == TTP_SAR_UNBOUND)) { |
1742 | { | ||
1743 | /* | 1739 | /* |
1744 | * A little optimizing. Only queue the fragment if | 1740 | * A little optimizing. Only queue the fragment if |
1745 | * there are other fragments. Since if this is the | 1741 | * there are other fragments. Since if this is the |
@@ -1860,7 +1856,7 @@ static int irttp_seq_show(struct seq_file *seq, void *v) | |||
1860 | seq_printf(seq, "dtsap_sel: %02x\n", | 1856 | seq_printf(seq, "dtsap_sel: %02x\n", |
1861 | self->dtsap_sel); | 1857 | self->dtsap_sel); |
1862 | seq_printf(seq, " connected: %s, ", | 1858 | seq_printf(seq, " connected: %s, ", |
1863 | self->connected? "TRUE":"FALSE"); | 1859 | self->connected ? "TRUE" : "FALSE"); |
1864 | seq_printf(seq, "avail credit: %d, ", | 1860 | seq_printf(seq, "avail credit: %d, ", |
1865 | self->avail_credit); | 1861 | self->avail_credit); |
1866 | seq_printf(seq, "remote credit: %d, ", | 1862 | seq_printf(seq, "remote credit: %d, ", |
@@ -1876,9 +1872,9 @@ static int irttp_seq_show(struct seq_file *seq, void *v) | |||
1876 | seq_printf(seq, "rx_queue len: %u\n", | 1872 | seq_printf(seq, "rx_queue len: %u\n", |
1877 | skb_queue_len(&self->rx_queue)); | 1873 | skb_queue_len(&self->rx_queue)); |
1878 | seq_printf(seq, " tx_sdu_busy: %s, ", | 1874 | seq_printf(seq, " tx_sdu_busy: %s, ", |
1879 | self->tx_sdu_busy? "TRUE":"FALSE"); | 1875 | self->tx_sdu_busy ? "TRUE" : "FALSE"); |
1880 | seq_printf(seq, "rx_sdu_busy: %s\n", | 1876 | seq_printf(seq, "rx_sdu_busy: %s\n", |
1881 | self->rx_sdu_busy? "TRUE":"FALSE"); | 1877 | self->rx_sdu_busy ? "TRUE" : "FALSE"); |
1882 | seq_printf(seq, " max_seg_size: %u, ", | 1878 | seq_printf(seq, " max_seg_size: %u, ", |
1883 | self->max_seg_size); | 1879 | self->max_seg_size); |
1884 | seq_printf(seq, "tx_max_sdu_size: %u, ", | 1880 | seq_printf(seq, "tx_max_sdu_size: %u, ", |