[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdm2VyCzfmG6707osmtyniV-oL-ism08kER49D7p_7x+Rg@mail.gmail.com>
Date: Wed, 19 Apr 2023 14:45:58 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: kernel test robot <lkp@...el.com>,
Robert Elliott <elliott@....com>, llvm@...ts.linux.dev,
oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Nathan Huckleberry <nhuck@...gle.com>
Subject: Re: [PATCH] crypto: arm/sha1-neon - Fix clang function cast warnings
On Wed, Apr 19, 2023 at 2:27 AM Herbert Xu <herbert@...dor.apana.org.au> wrote:
>
> Instead of casting the function which upsets clang for some reason,
> change the assembly function siganture instead.
s/siganture/signature/
Thanks for the patch! Perhaps worth noting in the commit message that
this fixes an instance of -Wcast-function-type-strict triggered for
W=1 builds, which helps us catch potential kCFI violations at compile
time rather than runtime.
After this patch, there's only 4 more users of the sha1_block_fn
typedef, consider if that typedef is a candidate for removal now?
Also, you should update the comment in
arch/arm/crypto/sha1-armv7-neon.S above the assembler implementation
on L288-289 to reflect this revised fn signature, in this patch.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202304081828.zjGcFUyE-lkp@intel.com/
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
>
> diff --git a/arch/arm/crypto/sha1_neon_glue.c b/arch/arm/crypto/sha1_neon_glue.c
> index cfe36ae0f3f5..9c70b87e69f7 100644
> --- a/arch/arm/crypto/sha1_neon_glue.c
> +++ b/arch/arm/crypto/sha1_neon_glue.c
> @@ -26,8 +26,8 @@
>
> #include "sha1.h"
>
> -asmlinkage void sha1_transform_neon(void *state_h, const char *data,
> - unsigned int rounds);
> +asmlinkage void sha1_transform_neon(struct sha1_state *state_h,
> + const u8 *data, int rounds);
>
> static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
> unsigned int len)
> @@ -39,8 +39,7 @@ static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
> return sha1_update_arm(desc, data, len);
>
> kernel_neon_begin();
> - sha1_base_do_update(desc, data, len,
> - (sha1_block_fn *)sha1_transform_neon);
> + sha1_base_do_update(desc, data, len, sha1_transform_neon);
> kernel_neon_end();
>
> return 0;
> @@ -54,9 +53,8 @@ static int sha1_neon_finup(struct shash_desc *desc, const u8 *data,
>
> kernel_neon_begin();
> if (len)
> - sha1_base_do_update(desc, data, len,
> - (sha1_block_fn *)sha1_transform_neon);
> - sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_transform_neon);
> + sha1_base_do_update(desc, data, len, sha1_transform_neon);
> + sha1_base_do_finalize(desc, sha1_transform_neon);
> kernel_neon_end();
>
> return sha1_base_finish(desc, out);
> --
> Email: Herbert Xu <herbert@...dor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists