aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-01-19 04:02:24 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-20 18:45:51 -0500
commitf766755c3057c36dc0796d2b0c633611dde6eccf (patch)
tree06207830bbbba741a1f09d70ab8fcb4dcf451c96 /drivers/ntb
parent170d35a57cf2c87bbfdfe6ec0485f678bdb53737 (diff)
NTB: whitespace cleanups
Whitespace cleanups found via `indent` Signed-off-by: Jon Mason <jon.mason@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ntb')
-rw-r--r--drivers/ntb/ntb_transport.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 903a72e7d112..e11b57e1939c 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -930,7 +930,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
930 930
931 if (!(hdr->flags & DESC_DONE_FLAG)) { 931 if (!(hdr->flags & DESC_DONE_FLAG)) {
932 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 932 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
933 &qp->rx_pend_q); 933 &qp->rx_pend_q);
934 qp->rx_ring_empty++; 934 qp->rx_ring_empty++;
935 return -EAGAIN; 935 return -EAGAIN;
936 } 936 }
@@ -940,7 +940,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
940 "qp %d: version mismatch, expected %llu - got %llu\n", 940 "qp %d: version mismatch, expected %llu - got %llu\n",
941 qp->qp_num, qp->rx_pkts, hdr->ver); 941 qp->qp_num, qp->rx_pkts, hdr->ver);
942 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 942 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
943 &qp->rx_pend_q); 943 &qp->rx_pend_q);
944 qp->rx_err_ver++; 944 qp->rx_err_ver++;
945 return -EIO; 945 return -EIO;
946 } 946 }
@@ -949,7 +949,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
949 ntb_qp_link_down(qp); 949 ntb_qp_link_down(qp);
950 950
951 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 951 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
952 &qp->rx_pend_q); 952 &qp->rx_pend_q);
953 953
954 /* Ensure that the data is fully copied out before clearing the 954 /* Ensure that the data is fully copied out before clearing the
955 * done flag 955 * done flag
@@ -967,7 +967,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
967 ntb_rx_copy_task(qp, entry, offset); 967 ntb_rx_copy_task(qp, entry, offset);
968 else { 968 else {
969 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 969 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry,
970 &qp->rx_pend_q); 970 &qp->rx_pend_q);
971 971
972 /* Ensure that the data is fully copied out before clearing the 972 /* Ensure that the data is fully copied out before clearing the
973 * done flag 973 * done flag
@@ -1057,8 +1057,8 @@ static int ntb_process_tx(struct ntb_transport_qp *qp,
1057 hdr = offset + qp->tx_max_frame - sizeof(struct ntb_payload_header); 1057 hdr = offset + qp->tx_max_frame - sizeof(struct ntb_payload_header);
1058 1058
1059 dev_dbg(&ntb_query_pdev(qp->ndev)->dev, "%lld - offset %p, tx %p, entry len %d flags %x buff %p\n", 1059 dev_dbg(&ntb_query_pdev(qp->ndev)->dev, "%lld - offset %p, tx %p, entry len %d flags %x buff %p\n",
1060 qp->tx_pkts, offset, qp->tx_offset, entry->len, entry->flags, 1060 qp->tx_pkts, offset, qp->tx_offset, entry->len, entry->flags,
1061 entry->buf); 1061 entry->buf);
1062 if (hdr->flags) { 1062 if (hdr->flags) {
1063 qp->tx_ring_full++; 1063 qp->tx_ring_full++;
1064 return -EAGAIN; 1064 return -EAGAIN;
@@ -1097,8 +1097,7 @@ static void ntb_send_link_down(struct ntb_transport_qp *qp)
1097 dev_info(&pdev->dev, "qp %d: Link Down\n", qp->qp_num); 1097 dev_info(&pdev->dev, "qp %d: Link Down\n", qp->qp_num);
1098 1098
1099 for (i = 0; i < NTB_LINK_DOWN_TIMEOUT; i++) { 1099 for (i = 0; i < NTB_LINK_DOWN_TIMEOUT; i++) {
1100 entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, 1100 entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q);
1101 &qp->tx_free_q);
1102 if (entry) 1101 if (entry)
1103 break; 1102 break;
1104 msleep(100); 1103 msleep(100);
@@ -1167,7 +1166,7 @@ ntb_transport_create_queue(void *data, struct pci_dev *pdev,
1167 goto err1; 1166 goto err1;
1168 1167
1169 ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry, 1168 ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry,
1170 &qp->rx_free_q); 1169 &qp->rx_free_q);
1171 } 1170 }
1172 1171
1173 for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { 1172 for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) {
@@ -1176,7 +1175,7 @@ ntb_transport_create_queue(void *data, struct pci_dev *pdev,
1176 goto err2; 1175 goto err2;
1177 1176
1178 ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry, 1177 ntb_list_add(&qp->ntb_tx_free_q_lock, &entry->entry,
1179 &qp->tx_free_q); 1178 &qp->tx_free_q);
1180 } 1179 }
1181 1180
1182 tasklet_init(&qp->rx_work, ntb_transport_rx, (unsigned long) qp); 1181 tasklet_init(&qp->rx_work, ntb_transport_rx, (unsigned long) qp);
@@ -1193,12 +1192,10 @@ ntb_transport_create_queue(void *data, struct pci_dev *pdev,
1193err3: 1192err3:
1194 tasklet_disable(&qp->rx_work); 1193 tasklet_disable(&qp->rx_work);
1195err2: 1194err2:
1196 while ((entry = 1195 while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
1197 ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
1198 kfree(entry); 1196 kfree(entry);
1199err1: 1197err1:
1200 while ((entry = 1198 while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
1201 ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
1202 kfree(entry); 1199 kfree(entry);
1203 set_bit(free_queue, &nt->qp_bitmap); 1200 set_bit(free_queue, &nt->qp_bitmap);
1204err: 1201err:
@@ -1225,18 +1222,15 @@ void ntb_transport_free_queue(struct ntb_transport_qp *qp)
1225 ntb_unregister_db_callback(qp->ndev, qp->qp_num); 1222 ntb_unregister_db_callback(qp->ndev, qp->qp_num);
1226 tasklet_disable(&qp->rx_work); 1223 tasklet_disable(&qp->rx_work);
1227 1224
1228 while ((entry = 1225 while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
1229 ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q)))
1230 kfree(entry); 1226 kfree(entry);
1231 1227
1232 while ((entry = 1228 while ((entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) {
1233 ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) {
1234 dev_warn(&pdev->dev, "Freeing item from a non-empty queue\n"); 1229 dev_warn(&pdev->dev, "Freeing item from a non-empty queue\n");
1235 kfree(entry); 1230 kfree(entry);
1236 } 1231 }
1237 1232
1238 while ((entry = 1233 while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
1239 ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q)))
1240 kfree(entry); 1234 kfree(entry);
1241 1235
1242 set_bit(qp->qp_num, &qp->transport->qp_bitmap); 1236 set_bit(qp->qp_num, &qp->transport->qp_bitmap);
@@ -1270,8 +1264,7 @@ void *ntb_transport_rx_remove(struct ntb_transport_qp *qp, unsigned int *len)
1270 buf = entry->cb_data; 1264 buf = entry->cb_data;
1271 *len = entry->len; 1265 *len = entry->len;
1272 1266
1273 ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry, 1267 ntb_list_add(&qp->ntb_rx_free_q_lock, &entry->entry, &qp->rx_free_q);
1274 &qp->rx_free_q);
1275 1268
1276 return buf; 1269 return buf;
1277} 1270}
@@ -1305,8 +1298,7 @@ int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
1305 entry->buf = data; 1298 entry->buf = data;
1306 entry->len = len; 1299 entry->len = len;
1307 1300
1308 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, 1301 ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, &qp->rx_pend_q);
1309 &qp->rx_pend_q);
1310 1302
1311 return 0; 1303 return 0;
1312} 1304}