diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2024-03-22 14:22:48 +0100 |
|---|---|---|
| committer | Jarkko Sakkinen <jarkko@kernel.org> | 2026-04-21 18:54:28 +0300 |
| commit | 6f1d4d2ecfcd1b577dc87350ea965fe81f272e83 (patch) | |
| tree | 3705356cc8ed08d00f4e83ff0a687a3950643e83 /include/linux | |
| parent | c424d2664f08c77f08b4580b5f0cbaabf7c229b2 (diff) | |
tpm: avoid -Wunused-but-set-variable
Outside of the EFI tpm code, the TPM_MEMREMAP()/TPM_MEMUNMAP functions are
defined as trivial macros, leading to the mapping_size variable ending
up unused:
In file included from drivers/char/tpm/tpm-sysfs.c:16:
In file included from drivers/char/tpm/tpm.h:28:
include/linux/tpm_eventlog.h:167:6: error: variable 'mapping_size' set but not used [-Werror,-Wunused-but-set-variable]
167 | int mapping_size;
Turn the stubs into inline functions to avoid this warning.
Cc: stable@vger.kernel.org # v5.3+
Fixes: c46f3405692d ("tpm: Reserve the TPM final events table")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tpm_eventlog.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h index 891368e82558..aff8ea2fa98e 100644 --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -131,11 +131,16 @@ struct tcg_algorithm_info { }; #ifndef TPM_MEMREMAP -#define TPM_MEMREMAP(start, size) NULL +static inline void *TPM_MEMREMAP(unsigned long start, size_t size) +{ + return NULL; +} #endif #ifndef TPM_MEMUNMAP -#define TPM_MEMUNMAP(start, size) do{} while(0) +static inline void TPM_MEMUNMAP(void *mapping, size_t size) +{ +} #endif /** |
