aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target.c
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2011-11-23 20:05:51 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2011-12-14 06:28:07 -0500
commit8359cf43b9dccddeebb0d247146719a14ce6371a (patch)
tree25421cb0e06d878709a826edf8d724ca102ab441 /drivers/target/iscsi/iscsi_target.c
parentfeae85644f1460b3373ef5141183ee43e6191b58 (diff)
target: remove useless casts
A reader should spend an extra moment whenever noticing a cast, because either something special is going on that deserves extra attention or, as is all too often the case, the code is wrong. These casts, afaics, have all been useless. They cast a foo* to a foo*, cast a void* to the assigned type, cast a foo* to void*, before assigning it to a void* variable, etc. In a few cases I also removed an additional &...[0], which is equally useless. Lastly I added three FIXMEs where, to the best of my judgement, the code appears to have a bug. It would be good if someone could check these. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target.c')
-rw-r--r--drivers/target/iscsi/iscsi_target.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index f74a62d46eea..ac44af165b27 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -283,8 +283,8 @@ static struct iscsi_np *iscsit_get_np(
283 sock_in6 = (struct sockaddr_in6 *)sockaddr; 283 sock_in6 = (struct sockaddr_in6 *)sockaddr;
284 sock_in6_e = (struct sockaddr_in6 *)&np->np_sockaddr; 284 sock_in6_e = (struct sockaddr_in6 *)&np->np_sockaddr;
285 285
286 if (!memcmp((void *)&sock_in6->sin6_addr.in6_u, 286 if (!memcmp(&sock_in6->sin6_addr.in6_u,
287 (void *)&sock_in6_e->sin6_addr.in6_u, 287 &sock_in6_e->sin6_addr.in6_u,
288 sizeof(struct in6_addr))) 288 sizeof(struct in6_addr)))
289 ip_match = 1; 289 ip_match = 1;
290 290
@@ -1224,7 +1224,7 @@ static void iscsit_do_crypto_hash_buf(
1224 1224
1225 crypto_hash_init(hash); 1225 crypto_hash_init(hash);
1226 1226
1227 sg_init_one(&sg, (u8 *)buf, payload_length); 1227 sg_init_one(&sg, buf, payload_length);
1228 crypto_hash_update(hash, &sg, payload_length); 1228 crypto_hash_update(hash, &sg, payload_length);
1229 1229
1230 if (padding) { 1230 if (padding) {
@@ -1602,7 +1602,7 @@ static int iscsit_handle_nop_out(
1602 /* 1602 /*
1603 * Attach ping data to struct iscsi_cmd->buf_ptr. 1603 * Attach ping data to struct iscsi_cmd->buf_ptr.
1604 */ 1604 */
1605 cmd->buf_ptr = (void *)ping_data; 1605 cmd->buf_ptr = ping_data;
1606 cmd->buf_ptr_size = payload_length; 1606 cmd->buf_ptr_size = payload_length;
1607 1607
1608 pr_debug("Got %u bytes of NOPOUT ping" 1608 pr_debug("Got %u bytes of NOPOUT ping"
@@ -3196,7 +3196,7 @@ static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd)
3196 end_of_buf = 1; 3196 end_of_buf = 1;
3197 goto eob; 3197 goto eob;
3198 } 3198 }
3199 memcpy((void *)payload + payload_len, buf, len); 3199 memcpy(payload + payload_len, buf, len);
3200 payload_len += len; 3200 payload_len += len;
3201 3201
3202 spin_lock(&tiqn->tiqn_tpg_lock); 3202 spin_lock(&tiqn->tiqn_tpg_lock);
@@ -3228,7 +3228,7 @@ static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd)
3228 end_of_buf = 1; 3228 end_of_buf = 1;
3229 goto eob; 3229 goto eob;
3230 } 3230 }
3231 memcpy((void *)payload + payload_len, buf, len); 3231 memcpy(payload + payload_len, buf, len);
3232 payload_len += len; 3232 payload_len += len;
3233 } 3233 }
3234 spin_unlock(&tpg->tpg_np_lock); 3234 spin_unlock(&tpg->tpg_np_lock);
@@ -3485,7 +3485,7 @@ int iscsi_target_tx_thread(void *arg)
3485 struct iscsi_conn *conn; 3485 struct iscsi_conn *conn;
3486 struct iscsi_queue_req *qr = NULL; 3486 struct iscsi_queue_req *qr = NULL;
3487 struct se_cmd *se_cmd; 3487 struct se_cmd *se_cmd;
3488 struct iscsi_thread_set *ts = (struct iscsi_thread_set *)arg; 3488 struct iscsi_thread_set *ts = arg;
3489 /* 3489 /*
3490 * Allow ourselves to be interrupted by SIGINT so that a 3490 * Allow ourselves to be interrupted by SIGINT so that a
3491 * connection recovery / failure event can be triggered externally. 3491 * connection recovery / failure event can be triggered externally.
@@ -3774,7 +3774,7 @@ int iscsi_target_rx_thread(void *arg)
3774 u8 buffer[ISCSI_HDR_LEN], opcode; 3774 u8 buffer[ISCSI_HDR_LEN], opcode;
3775 u32 checksum = 0, digest = 0; 3775 u32 checksum = 0, digest = 0;
3776 struct iscsi_conn *conn = NULL; 3776 struct iscsi_conn *conn = NULL;
3777 struct iscsi_thread_set *ts = (struct iscsi_thread_set *)arg; 3777 struct iscsi_thread_set *ts = arg;
3778 struct kvec iov; 3778 struct kvec iov;
3779 /* 3779 /*
3780 * Allow ourselves to be interrupted by SIGINT so that a 3780 * Allow ourselves to be interrupted by SIGINT so that a