aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-05-03 17:15:57 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-05-03 19:49:48 -0400
commit80690fdb959a652e02d4f40a684bd39586be9f32 (patch)
tree445e9d043b648e5ed4fcd130cb8ff1ba69f2fdfb /drivers/target/iscsi
parentbfbdb31d41b3d868449de272da746d1c2d0b764e (diff)
iscsi-target: Make buf param of iscsit_do_crypto_hash_buf() const void *
Make the "buf" input param of iscsit_do_crypto_hash_buf() "const void *". This allows to remove lots of casts in its callers. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r--drivers/target/iscsi/iscsi_target.c57
1 files changed, 23 insertions, 34 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index c230eacc6ced..262ef1f23b38 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1250,7 +1250,7 @@ static u32 iscsit_do_crypto_hash_sg(
1250 1250
1251static void iscsit_do_crypto_hash_buf( 1251static void iscsit_do_crypto_hash_buf(
1252 struct hash_desc *hash, 1252 struct hash_desc *hash,
1253 unsigned char *buf, 1253 const void *buf,
1254 u32 payload_length, 1254 u32 payload_length,
1255 u32 padding, 1255 u32 padding,
1256 u8 *pad_bytes, 1256 u8 *pad_bytes,
@@ -2524,9 +2524,8 @@ static int iscsit_send_conn_drop_async_message(
2524 if (conn->conn_ops->HeaderDigest) { 2524 if (conn->conn_ops->HeaderDigest) {
2525 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 2525 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
2526 2526
2527 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 2527 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
2528 (unsigned char *)hdr, ISCSI_HDR_LEN, 2528 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
2529 0, NULL, (u8 *)header_digest);
2530 2529
2531 cmd->tx_size += ISCSI_CRC_LEN; 2530 cmd->tx_size += ISCSI_CRC_LEN;
2532 pr_debug("Attaching CRC32C HeaderDigest to" 2531 pr_debug("Attaching CRC32C HeaderDigest to"
@@ -2662,9 +2661,8 @@ static int iscsit_send_datain(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2662 if (conn->conn_ops->HeaderDigest) { 2661 if (conn->conn_ops->HeaderDigest) {
2663 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 2662 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
2664 2663
2665 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 2664 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->pdu,
2666 (unsigned char *)cmd->pdu, ISCSI_HDR_LEN, 2665 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
2667 0, NULL, (u8 *)header_digest);
2668 2666
2669 iov[0].iov_len += ISCSI_CRC_LEN; 2667 iov[0].iov_len += ISCSI_CRC_LEN;
2670 tx_size += ISCSI_CRC_LEN; 2668 tx_size += ISCSI_CRC_LEN;
@@ -2841,9 +2839,8 @@ iscsit_send_logout(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2841 if (conn->conn_ops->HeaderDigest) { 2839 if (conn->conn_ops->HeaderDigest) {
2842 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 2840 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
2843 2841
2844 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 2842 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, &cmd->pdu[0],
2845 (unsigned char *)&cmd->pdu[0], ISCSI_HDR_LEN, 2843 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
2846 0, NULL, (u8 *)header_digest);
2847 2844
2848 iov[0].iov_len += ISCSI_CRC_LEN; 2845 iov[0].iov_len += ISCSI_CRC_LEN;
2849 tx_size += ISCSI_CRC_LEN; 2846 tx_size += ISCSI_CRC_LEN;
@@ -2900,9 +2897,8 @@ static int iscsit_send_unsolicited_nopin(
2900 if (conn->conn_ops->HeaderDigest) { 2897 if (conn->conn_ops->HeaderDigest) {
2901 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 2898 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
2902 2899
2903 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 2900 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
2904 (unsigned char *)hdr, ISCSI_HDR_LEN, 2901 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
2905 0, NULL, (u8 *)header_digest);
2906 2902
2907 tx_size += ISCSI_CRC_LEN; 2903 tx_size += ISCSI_CRC_LEN;
2908 pr_debug("Attaching CRC32C HeaderDigest to" 2904 pr_debug("Attaching CRC32C HeaderDigest to"
@@ -2949,9 +2945,8 @@ iscsit_send_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2949 if (conn->conn_ops->HeaderDigest) { 2945 if (conn->conn_ops->HeaderDigest) {
2950 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 2946 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
2951 2947
2952 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 2948 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
2953 (unsigned char *)hdr, ISCSI_HDR_LEN, 2949 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
2954 0, NULL, (u8 *)header_digest);
2955 2950
2956 iov[0].iov_len += ISCSI_CRC_LEN; 2951 iov[0].iov_len += ISCSI_CRC_LEN;
2957 tx_size += ISCSI_CRC_LEN; 2952 tx_size += ISCSI_CRC_LEN;
@@ -3040,9 +3035,8 @@ static int iscsit_send_r2t(
3040 if (conn->conn_ops->HeaderDigest) { 3035 if (conn->conn_ops->HeaderDigest) {
3041 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 3036 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
3042 3037
3043 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3038 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
3044 (unsigned char *)hdr, ISCSI_HDR_LEN, 3039 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
3045 0, NULL, (u8 *)header_digest);
3046 3040
3047 cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN; 3041 cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
3048 tx_size += ISCSI_CRC_LEN; 3042 tx_size += ISCSI_CRC_LEN;
@@ -3256,9 +3250,8 @@ static int iscsit_send_response(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
3256 if (conn->conn_ops->HeaderDigest) { 3250 if (conn->conn_ops->HeaderDigest) {
3257 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 3251 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
3258 3252
3259 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3253 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->pdu,
3260 (unsigned char *)cmd->pdu, ISCSI_HDR_LEN, 3254 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
3261 0, NULL, (u8 *)header_digest);
3262 3255
3263 iov[0].iov_len += ISCSI_CRC_LEN; 3256 iov[0].iov_len += ISCSI_CRC_LEN;
3264 tx_size += ISCSI_CRC_LEN; 3257 tx_size += ISCSI_CRC_LEN;
@@ -3329,9 +3322,8 @@ iscsit_send_task_mgt_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
3329 if (conn->conn_ops->HeaderDigest) { 3322 if (conn->conn_ops->HeaderDigest) {
3330 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 3323 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
3331 3324
3332 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3325 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
3333 (unsigned char *)hdr, ISCSI_HDR_LEN, 3326 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
3334 0, NULL, (u8 *)header_digest);
3335 3327
3336 cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN; 3328 cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
3337 tx_size += ISCSI_CRC_LEN; 3329 tx_size += ISCSI_CRC_LEN;
@@ -3504,9 +3496,8 @@ static int iscsit_send_text_rsp(
3504 if (conn->conn_ops->HeaderDigest) { 3496 if (conn->conn_ops->HeaderDigest) {
3505 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 3497 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
3506 3498
3507 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3499 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
3508 (unsigned char *)hdr, ISCSI_HDR_LEN, 3500 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
3509 0, NULL, (u8 *)header_digest);
3510 3501
3511 iov[0].iov_len += ISCSI_CRC_LEN; 3502 iov[0].iov_len += ISCSI_CRC_LEN;
3512 tx_size += ISCSI_CRC_LEN; 3503 tx_size += ISCSI_CRC_LEN;
@@ -3574,9 +3565,8 @@ static int iscsit_send_reject(
3574 if (conn->conn_ops->HeaderDigest) { 3565 if (conn->conn_ops->HeaderDigest) {
3575 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; 3566 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
3576 3567
3577 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3568 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
3578 (unsigned char *)hdr, ISCSI_HDR_LEN, 3569 ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
3579 0, NULL, (u8 *)header_digest);
3580 3570
3581 iov[0].iov_len += ISCSI_CRC_LEN; 3571 iov[0].iov_len += ISCSI_CRC_LEN;
3582 tx_size += ISCSI_CRC_LEN; 3572 tx_size += ISCSI_CRC_LEN;
@@ -3585,9 +3575,8 @@ static int iscsit_send_reject(
3585 } 3575 }
3586 3576
3587 if (conn->conn_ops->DataDigest) { 3577 if (conn->conn_ops->DataDigest) {
3588 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, 3578 iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->buf_ptr,
3589 (unsigned char *)cmd->buf_ptr, ISCSI_HDR_LEN, 3579 ISCSI_HDR_LEN, 0, NULL, (u8 *)&cmd->data_crc);
3590 0, NULL, (u8 *)&cmd->data_crc);
3591 3580
3592 iov[iov_count].iov_base = &cmd->data_crc; 3581 iov[iov_count].iov_base = &cmd->data_crc;
3593 iov[iov_count++].iov_len = ISCSI_CRC_LEN; 3582 iov[iov_count++].iov_len = ISCSI_CRC_LEN;