[PATCH] crypto: arm64/ghash - Reduce boilerplate

Eric Biggers ebiggers at kernel.org
Tue Nov 10 13:06:30 PST 2026


On Mon, Nov 09, 2026 at 05:45:02PM +0100, Uwe Kleine-König wrote:
> Make use of module_cpu_feature_match() which expands to nearly the code
> that is typed out.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
> ---
>  arch/arm64/crypto/ghash-ce-glue.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c
> index eaf2932ceaf5..0884f812a315 100644
> --- a/arch/arm64/crypto/ghash-ce-glue.c
> +++ b/arch/arm64/crypto/ghash-ce-glue.c
> @@ -384,7 +384,8 @@ static struct aead_alg gcm_aes_algs[] = {{
>  
>  static int __init ghash_ce_mod_init(void)
>  {
> -	if (!cpu_have_named_feature(ASIMD) || !cpu_have_named_feature(PMULL))
> +	/* ASIMD is implied by PMULL, but better be safe than sorry */
> +	if (!cpu_have_named_feature(ASIMD))
>  		return -ENODEV;

The ASIMD check can be dropped too.  There's already other code that
assumes PMULL implies ASIMD.

- Eric



More information about the linux-arm-kernel mailing list