Skip to content

Commit bed4593

Browse files
chenhuacaijarkkojs
authored andcommitted
tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH
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: 44038bc ("tpm: Abstract crypto agile event size calculations") Cc: [email protected] # v5.3 Reported-by: WANG Xuerui <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent ffd056f commit bed4593

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/tpm_eventlog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct tcg_algorithm_info {
157157
* Return: size of the event on success, 0 on failure
158158
*/
159159

160-
static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
160+
static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
161161
struct tcg_pcr_event *event_header,
162162
bool do_mapping)
163163
{

0 commit comments

Comments
 (0)