1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-23 08:35:19 -05:00

crypto: arm/sha1 - Fix clang function cast warnings

Instead of casting the function which upsets clang for some reason,
change the assembly function siganture instead.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu 2022-12-13 18:43:30 +08:00
parent 4838c5195a
commit b517b0fbfe

View file

@ -21,31 +21,29 @@
#include "sha1.h" #include "sha1.h"
asmlinkage void sha1_block_data_order(u32 *digest, asmlinkage void sha1_block_data_order(struct sha1_state *digest,
const unsigned char *data, unsigned int rounds); const u8 *data, int rounds);
int sha1_update_arm(struct shash_desc *desc, const u8 *data, int sha1_update_arm(struct shash_desc *desc, const u8 *data,
unsigned int len) unsigned int len)
{ {
/* make sure casting to sha1_block_fn() is safe */ /* make sure signature matches sha1_block_fn() */
BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0); BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0);
return sha1_base_do_update(desc, data, len, return sha1_base_do_update(desc, data, len, sha1_block_data_order);
(sha1_block_fn *)sha1_block_data_order);
} }
EXPORT_SYMBOL_GPL(sha1_update_arm); EXPORT_SYMBOL_GPL(sha1_update_arm);
static int sha1_final(struct shash_desc *desc, u8 *out) static int sha1_final(struct shash_desc *desc, u8 *out)
{ {
sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_block_data_order); sha1_base_do_finalize(desc, sha1_block_data_order);
return sha1_base_finish(desc, out); return sha1_base_finish(desc, out);
} }
int sha1_finup_arm(struct shash_desc *desc, const u8 *data, int sha1_finup_arm(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out) unsigned int len, u8 *out)
{ {
sha1_base_do_update(desc, data, len, sha1_base_do_update(desc, data, len, sha1_block_data_order);
(sha1_block_fn *)sha1_block_data_order);
return sha1_final(desc, out); return sha1_final(desc, out);
} }
EXPORT_SYMBOL_GPL(sha1_finup_arm); EXPORT_SYMBOL_GPL(sha1_finup_arm);