[linux-next:master 16504/16703] 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...

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   903c1cf6dff9964e71eda98a39e2e5d442050472
commit: 80d179c799e06db3a0ded6fdd71f292d9bef3fa5 [16504/16703] tpm: Move TPM common base definitions to the command header
config: arm-randconfig-002-20260823 (https://download.01.org/0day-ci/archive/20260823/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 935bfc708590c60147a79c7df145bb6e68b1d388)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260823/[email protected]/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
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   In file included from drivers/char/tpm/tpm_i2c_atmel.c:23:
   In file included from drivers/char/tpm/tpm.h:28:
   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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.