Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Arnd Bergmann and committed by
Jarkko Sakkinen
6f1d4d2e c424d266

+7 -2
+7 -2
include/linux/tpm_eventlog.h
··· 131 131 }; 132 132 133 133 #ifndef TPM_MEMREMAP 134 - #define TPM_MEMREMAP(start, size) NULL 134 + static inline void *TPM_MEMREMAP(unsigned long start, size_t size) 135 + { 136 + return NULL; 137 + } 135 138 #endif 136 139 137 140 #ifndef TPM_MEMUNMAP 138 - #define TPM_MEMUNMAP(start, size) do{} while(0) 141 + static inline void TPM_MEMUNMAP(void *mapping, size_t size) 142 + { 143 + } 139 144 #endif 140 145 141 146 /**