aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-12-07 09:09:57 -0500
committerRoland Dreier <roland@purestorage.com>2014-12-15 21:11:44 -0500
commit49df2781b101a729e9f46eddc845a587fc5665a8 (patch)
treea3674caff11a6c1618ef354a97d237ff048f1b21 /drivers/infiniband
parent6ec9d4d2310e8fc54fc638e4454271d1fcaefa95 (diff)
IB/iser: Fix sparse warnings
Use uintptr_t to handle wr_id casting, which was found by Kbuild test robot and smatch. Also remove an internal definition of variable which potentially shadows an external one (and make sparse happy). Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/iser/iser_memory.c1
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c15
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 6c5ce357fba6..5796c95be97b 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -73,7 +73,6 @@ static int iser_start_rdma_unaligned_sg(struct iscsi_iser_task *iser_task,
73 73
74 if (cmd_dir == ISER_DIR_OUT) { 74 if (cmd_dir == ISER_DIR_OUT) {
75 /* copy the unaligned sg the buffer which is used for RDMA */ 75 /* copy the unaligned sg the buffer which is used for RDMA */
76 int i;
77 char *p, *from; 76 char *p, *from;
78 77
79 sgl = (struct scatterlist *)data->buf; 78 sgl = (struct scatterlist *)data->buf;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 583b09e48409..fb5ec3553de8 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -1077,7 +1077,7 @@ int iser_post_recvl(struct iser_conn *iser_conn)
1077 sge.length = ISER_RX_LOGIN_SIZE; 1077 sge.length = ISER_RX_LOGIN_SIZE;
1078 sge.lkey = ib_conn->device->mr->lkey; 1078 sge.lkey = ib_conn->device->mr->lkey;
1079 1079
1080 rx_wr.wr_id = (unsigned long)iser_conn->login_resp_buf; 1080 rx_wr.wr_id = (uintptr_t)iser_conn->login_resp_buf;
1081 rx_wr.sg_list = &sge; 1081 rx_wr.sg_list = &sge;
1082 rx_wr.num_sge = 1; 1082 rx_wr.num_sge = 1;
1083 rx_wr.next = NULL; 1083 rx_wr.next = NULL;
@@ -1101,7 +1101,7 @@ int iser_post_recvm(struct iser_conn *iser_conn, int count)
1101 1101
1102 for (rx_wr = ib_conn->rx_wr, i = 0; i < count; i++, rx_wr++) { 1102 for (rx_wr = ib_conn->rx_wr, i = 0; i < count; i++, rx_wr++) {
1103 rx_desc = &iser_conn->rx_descs[my_rx_head]; 1103 rx_desc = &iser_conn->rx_descs[my_rx_head];
1104 rx_wr->wr_id = (unsigned long)rx_desc; 1104 rx_wr->wr_id = (uintptr_t)rx_desc;
1105 rx_wr->sg_list = &rx_desc->rx_sg; 1105 rx_wr->sg_list = &rx_desc->rx_sg;
1106 rx_wr->num_sge = 1; 1106 rx_wr->num_sge = 1;
1107 rx_wr->next = rx_wr + 1; 1107 rx_wr->next = rx_wr + 1;
@@ -1138,7 +1138,7 @@ int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc,
1138 DMA_TO_DEVICE); 1138 DMA_TO_DEVICE);
1139 1139
1140 send_wr.next = NULL; 1140 send_wr.next = NULL;
1141 send_wr.wr_id = (unsigned long)tx_desc; 1141 send_wr.wr_id = (uintptr_t)tx_desc;
1142 send_wr.sg_list = tx_desc->tx_sg; 1142 send_wr.sg_list = tx_desc->tx_sg;
1143 send_wr.num_sge = tx_desc->num_sge; 1143 send_wr.num_sge = tx_desc->num_sge;
1144 send_wr.opcode = IB_WR_SEND; 1144 send_wr.opcode = IB_WR_SEND;
@@ -1188,6 +1188,7 @@ static void
1188iser_handle_comp_error(struct ib_conn *ib_conn, 1188iser_handle_comp_error(struct ib_conn *ib_conn,
1189 struct ib_wc *wc) 1189 struct ib_wc *wc)
1190{ 1190{
1191 void *wr_id = (void *)(uintptr_t)wc->wr_id;
1191 struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn, 1192 struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
1192 ib_conn); 1193 ib_conn);
1193 1194
@@ -1196,8 +1197,8 @@ iser_handle_comp_error(struct ib_conn *ib_conn,
1196 iscsi_conn_failure(iser_conn->iscsi_conn, 1197 iscsi_conn_failure(iser_conn->iscsi_conn,
1197 ISCSI_ERR_CONN_FAILED); 1198 ISCSI_ERR_CONN_FAILED);
1198 1199
1199 if (is_iser_tx_desc(iser_conn, (void *)wc->wr_id)) { 1200 if (is_iser_tx_desc(iser_conn, wr_id)) {
1200 struct iser_tx_desc *desc = (struct iser_tx_desc *)wc->wr_id; 1201 struct iser_tx_desc *desc = wr_id;
1201 1202
1202 if (desc->type == ISCSI_TX_DATAOUT) 1203 if (desc->type == ISCSI_TX_DATAOUT)
1203 kmem_cache_free(ig.desc_cache, desc); 1204 kmem_cache_free(ig.desc_cache, desc);
@@ -1223,12 +1224,12 @@ static void iser_handle_wc(struct ib_wc *wc)
1223 ib_conn = wc->qp->qp_context; 1224 ib_conn = wc->qp->qp_context;
1224 if (wc->status == IB_WC_SUCCESS) { 1225 if (wc->status == IB_WC_SUCCESS) {
1225 if (wc->opcode == IB_WC_RECV) { 1226 if (wc->opcode == IB_WC_RECV) {
1226 rx_desc = (struct iser_rx_desc *)wc->wr_id; 1227 rx_desc = (struct iser_rx_desc *)(uintptr_t)wc->wr_id;
1227 iser_rcv_completion(rx_desc, wc->byte_len, 1228 iser_rcv_completion(rx_desc, wc->byte_len,
1228 ib_conn); 1229 ib_conn);
1229 } else 1230 } else
1230 if (wc->opcode == IB_WC_SEND) { 1231 if (wc->opcode == IB_WC_SEND) {
1231 tx_desc = (struct iser_tx_desc *)wc->wr_id; 1232 tx_desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
1232 iser_snd_completion(tx_desc, ib_conn); 1233 iser_snd_completion(tx_desc, ib_conn);
1233 } else { 1234 } else {
1234 iser_err("Unknown wc opcode %d\n", wc->opcode); 1235 iser_err("Unknown wc opcode %d\n", wc->opcode);