mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
Merge branch 'chelsio-crypto-fixes'
Ayush Sawal says:
====================
Fixing compilation warnings and errors
Patch 1: Fixes the warnings seen when compiling using sparse tool.
Patch 2: Fixes a cocci check error introduced after commit
567be3a5d2
("crypto: chelsio -
Use multiple txq/rxq per tfm to process the requests").
V1->V2
patch1: Avoid type casting by using get_unaligned_be32() and
put_unaligned_be16/32() functions.
patch2: Modified subject of the patch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
a56772dc3f
2 changed files with 6 additions and 7 deletions
|
@ -256,7 +256,7 @@ static void get_aes_decrypt_key(unsigned char *dec_key,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nk; i++)
|
for (i = 0; i < nk; i++)
|
||||||
w_ring[i] = be32_to_cpu(*(u32 *)&key[4 * i]);
|
w_ring[i] = get_unaligned_be32(&key[i * 4]);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
temp = w_ring[nk - 1];
|
temp = w_ring[nk - 1];
|
||||||
|
@ -275,7 +275,7 @@ static void get_aes_decrypt_key(unsigned char *dec_key,
|
||||||
}
|
}
|
||||||
i--;
|
i--;
|
||||||
for (k = 0, j = i % nk; k < nk; k++) {
|
for (k = 0, j = i % nk; k < nk; k++) {
|
||||||
*((u32 *)dec_key + k) = htonl(w_ring[j]);
|
put_unaligned_be32(w_ring[j], &dec_key[k * 4]);
|
||||||
j--;
|
j--;
|
||||||
if (j < 0)
|
if (j < 0)
|
||||||
j += nk;
|
j += nk;
|
||||||
|
@ -1464,6 +1464,7 @@ static int chcr_device_init(struct chcr_context *ctx)
|
||||||
if (!ctx->dev) {
|
if (!ctx->dev) {
|
||||||
u_ctx = assign_chcr_device();
|
u_ctx = assign_chcr_device();
|
||||||
if (!u_ctx) {
|
if (!u_ctx) {
|
||||||
|
err = -ENXIO;
|
||||||
pr_err("chcr device assignment fails\n");
|
pr_err("chcr device assignment fails\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2926,8 +2927,7 @@ static int ccm_format_packet(struct aead_request *req,
|
||||||
memcpy(ivptr, req->iv, 16);
|
memcpy(ivptr, req->iv, 16);
|
||||||
}
|
}
|
||||||
if (assoclen)
|
if (assoclen)
|
||||||
*((unsigned short *)(reqctx->scratch_pad + 16)) =
|
put_unaligned_be16(assoclen, &reqctx->scratch_pad[16]);
|
||||||
htons(assoclen);
|
|
||||||
|
|
||||||
rc = generate_b0(req, ivptr, op_type);
|
rc = generate_b0(req, ivptr, op_type);
|
||||||
/* zero the ctr value */
|
/* zero the ctr value */
|
||||||
|
@ -3201,8 +3201,7 @@ static struct sk_buff *create_gcm_wr(struct aead_request *req,
|
||||||
} else {
|
} else {
|
||||||
memcpy(ivptr, req->iv, GCM_AES_IV_SIZE);
|
memcpy(ivptr, req->iv, GCM_AES_IV_SIZE);
|
||||||
}
|
}
|
||||||
*((unsigned int *)(ivptr + 12)) = htonl(0x01);
|
put_unaligned_be32(0x01, &ivptr[12]);
|
||||||
|
|
||||||
ulptx = (struct ulptx_sgl *)(ivptr + 16);
|
ulptx = (struct ulptx_sgl *)(ivptr + 16);
|
||||||
|
|
||||||
chcr_add_aead_dst_ent(req, phys_cpl, qid);
|
chcr_add_aead_dst_ent(req, phys_cpl, qid);
|
||||||
|
|
|
@ -403,7 +403,7 @@ inline void *copy_esn_pktxt(struct sk_buff *skb,
|
||||||
xo = xfrm_offload(skb);
|
xo = xfrm_offload(skb);
|
||||||
|
|
||||||
aadiv->spi = (esphdr->spi);
|
aadiv->spi = (esphdr->spi);
|
||||||
seqlo = htonl(esphdr->seq_no);
|
seqlo = ntohl(esphdr->seq_no);
|
||||||
seqno = cpu_to_be64(seqlo + ((u64)xo->seq.hi << 32));
|
seqno = cpu_to_be64(seqlo + ((u64)xo->seq.hi << 32));
|
||||||
memcpy(aadiv->seq_no, &seqno, 8);
|
memcpy(aadiv->seq_no, &seqno, 8);
|
||||||
iv = skb_transport_header(skb) + sizeof(struct ip_esp_hdr);
|
iv = skb_transport_header(skb) + sizeof(struct ip_esp_hdr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue