Skip to content

Commit

Permalink
crypto: cpt - Fix sparse warnings in cptpf
Browse files Browse the repository at this point in the history
This patch fixes a few sparse warnings that were missed in the
last round.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Dec 4, 2020
1 parent a1315dc commit f2d4576
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/crypto/cavium/cpt/cptpf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static int do_cpt_init(struct cpt_device *cpt, struct microcode *mcode)

struct ucode_header {
u8 version[CPT_UCODE_VERSION_SZ];
u32 code_length;
__be32 code_length;
u32 data_length;
u64 sram_address;
};
Expand Down Expand Up @@ -288,10 +288,10 @@ static int cpt_ucode_load_fw(struct cpt_device *cpt, const u8 *fw, bool is_ae)

/* Byte swap 64-bit */
for (j = 0; j < (mcode->code_size / 8); j++)
((u64 *)mcode->code)[j] = cpu_to_be64(((u64 *)mcode->code)[j]);
((__be64 *)mcode->code)[j] = cpu_to_be64(((u64 *)mcode->code)[j]);
/* MC needs 16-bit swap */
for (j = 0; j < (mcode->code_size / 2); j++)
((u16 *)mcode->code)[j] = cpu_to_be16(((u16 *)mcode->code)[j]);
((__be16 *)mcode->code)[j] = cpu_to_be16(((u16 *)mcode->code)[j]);

dev_dbg(dev, "mcode->code_size = %u\n", mcode->code_size);
dev_dbg(dev, "mcode->is_ae = %u\n", mcode->is_ae);
Expand Down

0 comments on commit f2d4576

Please sign in to comment.