]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tpm: avoid -Wunused-but-set-variable
authorArnd Bergmann <arnd@arndb.de>
Fri, 22 Mar 2024 13:22:48 +0000 (14:22 +0100)
committerJarkko Sakkinen <jarkko@kernel.org>
Tue, 21 Apr 2026 15:54:28 +0000 (18:54 +0300)
commit6f1d4d2ecfcd1b577dc87350ea965fe81f272e83
tree3705356cc8ed08d00f4e83ff0a687a3950643e83
parentc424d2664f08c77f08b4580b5f0cbaabf7c229b2
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>
include/linux/tpm_eventlog.h