From: Huacai Chen Date: Mon, 11 Jul 2022 01:17:38 +0000 (+0800) Subject: tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH X-Git-Tag: baikal/mips/sdk5.9~26 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f0da9ac98541904f40d1f6f7399462d545d29cd8;p=kernel.git tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH [ Upstream commit 00c3ae02cde100ef1284de7f28338cf9029cda8e ] If DEBUG_SECTION_MISMATCH enabled, __calc_tpm2_event_size() will not be inlined, this cause section mismatch like this: WARNING: modpost: vmlinux.o(.text.unlikely+0xe30c): Section mismatch in reference from the variable L0 to the function .init.text:early_ioremap() The function L0() references the function __init early_memremap(). This is often because L0 lacks a __init annotation or the annotation of early_ioremap is wrong. Fix it by using __always_inline instead of inline for the called-once function __calc_tpm2_event_size(). Fixes: e1322134f1f2 ("tpm: Abstract crypto agile event size calculations") Cc: stable@vger.kernel.org # v5.3 Reported-by: WANG Xuerui Signed-off-by: Huacai Chen Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin --- diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h index 739ba9a03ec16..20c0ff54b7a0d 100644 --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -157,7 +157,7 @@ struct tcg_algorithm_info { * Return: size of the event on success, 0 on failure */ -static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, +static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, struct tcg_pcr_event *event_header, bool do_mapping) {