mirror of https://gitee.com/openkylin/linux.git
target/iscsi: Modify iscsit_do_crypto_hash_buf() prototype
Change the type of the last two arguments from u8 * into const void * and void * respectively such that the u8 * casts can be left out from the callers. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Mike Christie <mchristi@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
de3493aea6
commit
e1dfb21f00
|
@ -500,7 +500,7 @@ void iscsit_aborted_task(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
|
||||||
EXPORT_SYMBOL(iscsit_aborted_task);
|
EXPORT_SYMBOL(iscsit_aborted_task);
|
||||||
|
|
||||||
static void iscsit_do_crypto_hash_buf(struct ahash_request *, const void *,
|
static void iscsit_do_crypto_hash_buf(struct ahash_request *, const void *,
|
||||||
u32, u32, u8 *, u8 *);
|
u32, u32, const void *, void *);
|
||||||
static void iscsit_tx_thread_wait_for_tcp(struct iscsi_conn *);
|
static void iscsit_tx_thread_wait_for_tcp(struct iscsi_conn *);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -521,7 +521,7 @@ iscsit_xmit_nondatain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(conn->conn_tx_hash, hdr,
|
iscsit_do_crypto_hash_buf(conn->conn_tx_hash, hdr,
|
||||||
ISCSI_HDR_LEN, 0, NULL,
|
ISCSI_HDR_LEN, 0, NULL,
|
||||||
(u8 *)header_digest);
|
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;
|
||||||
|
@ -548,9 +548,8 @@ iscsit_xmit_nondatain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
|
||||||
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,
|
||||||
data_buf, data_buf_len,
|
data_buf, data_buf_len,
|
||||||
padding,
|
padding, &cmd->pad_bytes,
|
||||||
(u8 *)&cmd->pad_bytes,
|
&cmd->data_crc);
|
||||||
(u8 *)&cmd->data_crc);
|
|
||||||
|
|
||||||
iov[niov].iov_base = &cmd->data_crc;
|
iov[niov].iov_base = &cmd->data_crc;
|
||||||
iov[niov++].iov_len = ISCSI_CRC_LEN;
|
iov[niov++].iov_len = ISCSI_CRC_LEN;
|
||||||
|
@ -595,7 +594,7 @@ iscsit_xmit_datain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(conn->conn_tx_hash, cmd->pdu,
|
iscsit_do_crypto_hash_buf(conn->conn_tx_hash, cmd->pdu,
|
||||||
ISCSI_HDR_LEN, 0, NULL,
|
ISCSI_HDR_LEN, 0, NULL,
|
||||||
(u8 *)header_digest);
|
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;
|
||||||
|
@ -1408,13 +1407,9 @@ static u32 iscsit_do_crypto_hash_sg(
|
||||||
return data_crc;
|
return data_crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iscsit_do_crypto_hash_buf(
|
static void iscsit_do_crypto_hash_buf(struct ahash_request *hash,
|
||||||
struct ahash_request *hash,
|
const void *buf, u32 payload_length, u32 padding,
|
||||||
const void *buf,
|
const void *pad_bytes, void *data_crc)
|
||||||
u32 payload_length,
|
|
||||||
u32 padding,
|
|
||||||
u8 *pad_bytes,
|
|
||||||
u8 *data_crc)
|
|
||||||
{
|
{
|
||||||
struct scatterlist sg[2];
|
struct scatterlist sg[2];
|
||||||
|
|
||||||
|
@ -1876,10 +1871,9 @@ static int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->conn_ops->DataDigest) {
|
if (conn->conn_ops->DataDigest) {
|
||||||
iscsit_do_crypto_hash_buf(conn->conn_rx_hash,
|
iscsit_do_crypto_hash_buf(conn->conn_rx_hash, ping_data,
|
||||||
ping_data, payload_length,
|
payload_length, padding,
|
||||||
padding, cmd->pad_bytes,
|
cmd->pad_bytes, &data_crc);
|
||||||
(u8 *)&data_crc);
|
|
||||||
|
|
||||||
if (checksum != data_crc) {
|
if (checksum != data_crc) {
|
||||||
pr_err("Ping data CRC32C DataDigest"
|
pr_err("Ping data CRC32C DataDigest"
|
||||||
|
@ -2285,10 +2279,9 @@ iscsit_handle_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
|
||||||
goto reject;
|
goto reject;
|
||||||
|
|
||||||
if (conn->conn_ops->DataDigest) {
|
if (conn->conn_ops->DataDigest) {
|
||||||
iscsit_do_crypto_hash_buf(conn->conn_rx_hash,
|
iscsit_do_crypto_hash_buf(conn->conn_rx_hash, text_in,
|
||||||
text_in, payload_length,
|
payload_length, padding,
|
||||||
padding, (u8 *)&pad_bytes,
|
&pad_bytes, &data_crc);
|
||||||
(u8 *)&data_crc);
|
|
||||||
|
|
||||||
if (checksum != data_crc) {
|
if (checksum != data_crc) {
|
||||||
pr_err("Text data CRC32C DataDigest"
|
pr_err("Text data CRC32C DataDigest"
|
||||||
|
@ -3976,9 +3969,9 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
iscsit_do_crypto_hash_buf(conn->conn_rx_hash,
|
iscsit_do_crypto_hash_buf(conn->conn_rx_hash, buffer,
|
||||||
buffer, ISCSI_HDR_LEN,
|
ISCSI_HDR_LEN, 0, NULL,
|
||||||
0, NULL, (u8 *)&checksum);
|
&checksum);
|
||||||
|
|
||||||
if (digest != checksum) {
|
if (digest != checksum) {
|
||||||
pr_err("HeaderDigest CRC32C failed,"
|
pr_err("HeaderDigest CRC32C failed,"
|
||||||
|
|
Loading…
Reference in New Issue