Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: aspeed - fix type warnings

This patch fixes following warnings:

1. sparse: incorrect type in assignment (different base types)
Fix: change to __le32 type.
2. sparse: cast removes address space '__iomem' of expression
Fix: use readb to avoid dereferencing the memory.

Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Neal Liu and committed by
Herbert Xu
eaf05e82 acd4045d

+4 -4
+4 -4
drivers/crypto/aspeed/aspeed-acry.c
··· 252 252 enum aspeed_rsa_key_mode mode) 253 253 { 254 254 const u8 *src = xbuf; 255 - u32 *dw_buf = (u32 *)buf; 255 + __le32 *dw_buf = buf; 256 256 int nbits, ndw; 257 257 int i, j, idx; 258 258 u32 data = 0; ··· 302 302 static int aspeed_acry_rsa_transfer(struct aspeed_acry_dev *acry_dev) 303 303 { 304 304 struct akcipher_request *req = acry_dev->req; 305 - u8 *sram_buffer = (u8 *)acry_dev->acry_sram; 305 + u8 __iomem *sram_buffer = acry_dev->acry_sram; 306 306 struct scatterlist *out_sg = req->dst; 307 307 static u8 dram_buffer[ASPEED_ACRY_SRAM_MAX_LEN]; 308 308 int leading_zero = 1; ··· 321 321 322 322 for (j = ASPEED_ACRY_SRAM_MAX_LEN - 1; j >= 0; j--) { 323 323 data_idx = acry_dev->data_byte_mapping[j]; 324 - if (sram_buffer[data_idx] == 0 && leading_zero) { 324 + if (readb(sram_buffer + data_idx) == 0 && leading_zero) { 325 325 result_nbytes--; 326 326 } else { 327 327 leading_zero = 0; 328 - dram_buffer[i] = sram_buffer[data_idx]; 328 + dram_buffer[i] = readb(sram_buffer + data_idx); 329 329 i++; 330 330 } 331 331 }