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>
This commit is contained in:
parent
bfbdb31d41
commit
80690fdb95
|
@ -1250,7 +1250,7 @@ static u32 iscsit_do_crypto_hash_sg(
|
||||||
|
|
||||||
static void iscsit_do_crypto_hash_buf(
|
static void iscsit_do_crypto_hash_buf(
|
||||||
struct hash_desc *hash,
|
struct hash_desc *hash,
|
||||||
unsigned char *buf,
|
const void *buf,
|
||||||
u32 payload_length,
|
u32 payload_length,
|
||||||
u32 padding,
|
u32 padding,
|
||||||
u8 *pad_bytes,
|
u8 *pad_bytes,
|
||||||
|
@ -2524,9 +2524,8 @@ static int iscsit_send_conn_drop_async_message(
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
cmd->tx_size += ISCSI_CRC_LEN;
|
cmd->tx_size += ISCSI_CRC_LEN;
|
||||||
pr_debug("Attaching CRC32C HeaderDigest to"
|
pr_debug("Attaching CRC32C HeaderDigest to"
|
||||||
|
@ -2662,9 +2661,8 @@ static int iscsit_send_datain(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->pdu,
|
||||||
(unsigned char *)cmd->pdu, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -2841,9 +2839,8 @@ iscsit_send_logout(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, &cmd->pdu[0],
|
||||||
(unsigned char *)&cmd->pdu[0], ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -2900,9 +2897,8 @@ static int iscsit_send_unsolicited_nopin(
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
pr_debug("Attaching CRC32C HeaderDigest to"
|
pr_debug("Attaching CRC32C HeaderDigest to"
|
||||||
|
@ -2949,9 +2945,8 @@ iscsit_send_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3040,9 +3035,8 @@ static int iscsit_send_r2t(
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
|
cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3256,9 +3250,8 @@ static int iscsit_send_response(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->pdu,
|
||||||
(unsigned char *)cmd->pdu, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3329,9 +3322,8 @@ iscsit_send_task_mgt_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
|
cmd->iov_misc[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3504,9 +3496,8 @@ static int iscsit_send_text_rsp(
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3574,9 +3565,8 @@ static int iscsit_send_reject(
|
||||||
if (conn->conn_ops->HeaderDigest) {
|
if (conn->conn_ops->HeaderDigest) {
|
||||||
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN];
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, hdr,
|
||||||
(unsigned char *)hdr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)header_digest);
|
||||||
0, NULL, (u8 *)header_digest);
|
|
||||||
|
|
||||||
iov[0].iov_len += ISCSI_CRC_LEN;
|
iov[0].iov_len += ISCSI_CRC_LEN;
|
||||||
tx_size += ISCSI_CRC_LEN;
|
tx_size += ISCSI_CRC_LEN;
|
||||||
|
@ -3585,9 +3575,8 @@ static int iscsit_send_reject(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->conn_ops->DataDigest) {
|
if (conn->conn_ops->DataDigest) {
|
||||||
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash,
|
iscsit_do_crypto_hash_buf(&conn->conn_tx_hash, cmd->buf_ptr,
|
||||||
(unsigned char *)cmd->buf_ptr, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL, (u8 *)&cmd->data_crc);
|
||||||
0, NULL, (u8 *)&cmd->data_crc);
|
|
||||||
|
|
||||||
iov[iov_count].iov_base = &cmd->data_crc;
|
iov[iov_count].iov_base = &cmd->data_crc;
|
||||||
iov[iov_count++].iov_len = ISCSI_CRC_LEN;
|
iov[iov_count++].iov_len = ISCSI_CRC_LEN;
|
||||||
|
|
Loading…
Reference in a new issue