From: Eric Biggers <ebiggers@kernel.org>
To: Austin Kim <austindh.kim@gmail.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
catalin.marinas@arm.com, will@kernel.org,
john.johansen@canonical.com, jmorris@namei.org, serge@hallyn.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-security-module@vger.kernel.org,
linux-crypto@vger.kernel.org, austin.kim@lge.com
Subject: Re: [PATCH] crypto: arm64/gcm - remove Wunused-const-variable ghash_cpu_feature
Date: Thu, 27 May 2021 10:46:25 -0700 [thread overview]
Message-ID: <YK/a8f7MhO2SlrMS@gmail.com> (raw)
In-Reply-To: <20210527062809.GA1251@raspberrypi>
On Thu, May 27, 2021 at 07:28:09AM +0100, Austin Kim wrote:
>
> The variable with MODULE_DEVICE_TABLE() is registered as platform_driver.
What does this mean? There is no platform_driver involved here at all.
> But ghash_cpu_feature is not used, so remove ghash_cpu_feature.
It is used when the file is built as a module.
> diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c
> index 720cd3a58da3..c3f27d0d5329 100644
> --- a/arch/arm64/crypto/ghash-ce-glue.c
> +++ b/arch/arm64/crypto/ghash-ce-glue.c
> @@ -615,10 +615,5 @@ static void __exit ghash_ce_mod_exit(void)
> crypto_unregister_shash(&ghash_alg);
> }
>
> -static const struct cpu_feature ghash_cpu_feature[] = {
> - { cpu_feature(PMULL) }, { }
> -};
> -MODULE_DEVICE_TABLE(cpu, ghash_cpu_feature);
> -
Probably adding __maybe_unused to ghash_cpu_feature[] is the right thing to do.
That's what module_cpu_feature_match() does.
(Note that module_cpu_feature_match() can't be used here, as it seems the intent
is for this module to be autoloaded when PMULL is detected, but still be
loadable without it. So, that's apparently the reason for using
MODULE_DEVICE_TABLE() directly.)
- Eric
next prev parent reply other threads:[~2021-05-27 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 6:28 [PATCH] crypto: arm64/gcm - remove Wunused-const-variable ghash_cpu_feature Austin Kim
2021-05-27 17:46 ` Eric Biggers [this message]
2021-05-28 13:51 ` Austin Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YK/a8f7MhO2SlrMS@gmail.com \
--to=ebiggers@kernel.org \
--cc=austin.kim@lge.com \
--cc=austindh.kim@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).