include/linux/tpm_command.h:515:2: warning: field within 'struct tpm_header' is less aligned than 'union tpm_header::(anonymous at include/linux/tpm_command.h:515:2)' and is usually due to 'struct tpm_header' being packed, which can lead to unaligned acc...

From: kernel test robot

Date: Wed Sep 23 2026 - 12:59:02 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fe2ec83746e501645709761605c2464a44fd2929
commit: 88c5a62c3af7ca6f36dc6ffc52bcfb29cd2990cb tpm: Move TPM common base definitions to the command header
date: 4 weeks ago
config: arm-randconfig-1001-20260923 (https://download.01.org/0day-ci/archive/20260924/202609240044.aAnGhdJw-lkp@xxxxxxxxx/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 5dc57157f12f0ff676e823d9b4d98b45c07e5df2)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260924/202609240044.aAnGhdJw-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 88c5a62c3af7 ("tpm: Move TPM common base definitions to the command header")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609240044.aAnGhdJw-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from security/keys/trusted-keys/trusted_tpm2.c:11:
In file included from include/linux/tpm.h:28:
>> include/linux/tpm_command.h:515:2: warning: field within 'struct tpm_header' is less aligned than 'union tpm_header::(anonymous at include/linux/tpm_command.h:515:2)' and is usually due to 'struct tpm_header' being packed, which can lead to unaligned accesses [-Wunaligned-access]
515 | union {
| ^
1 warning generated.


vim +515 include/linux/tpm_command.h

511
512 struct tpm_header {
513 __be16 tag;
514 __be32 length;
> 515 union {
516 __be32 ordinal;
517 __be32 return_code;
518 };
519 } __packed;
520

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki