Skip to content

Commit

Permalink
crypto: arm64 - Fix unused variable compilation warnings of cpu_feature
Browse files Browse the repository at this point in the history
The cpu feature defined by MODULE_DEVICE_TABLE is only referenced when
compiling as a module, and the warning of unused variable will be
encountered when compiling with intree. The warning can be removed by
adding the __maybe_unused flag.

Fixes: 03c9a33 ("crypto: arm64/ghash - add NEON accelerated fallback for 64-bit PMULL")
Fixes: ae1b83c ("crypto: arm64/sm4 - add CE implementation for GCM mode")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Tianjia Zhang <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
uudiin authored and herbertx committed Nov 18, 2022
1 parent 4f1c596 commit 824db5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arm64/crypto/ghash-ce-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static void __exit ghash_ce_mod_exit(void)
crypto_unregister_shash(&ghash_alg);
}

static const struct cpu_feature ghash_cpu_feature[] = {
static const struct cpu_feature __maybe_unused ghash_cpu_feature[] = {
{ cpu_feature(PMULL) }, { }
};
MODULE_DEVICE_TABLE(cpu, ghash_cpu_feature);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/crypto/sm4-ce-gcm-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static void __exit sm4_ce_gcm_exit(void)
crypto_unregister_aead(&sm4_gcm_alg);
}

static const struct cpu_feature sm4_ce_gcm_cpu_feature[] = {
static const struct cpu_feature __maybe_unused sm4_ce_gcm_cpu_feature[] = {
{ cpu_feature(PMULL) },
{}
};
Expand Down

0 comments on commit 824db5c

Please sign in to comment.