Re: [PATCH 4/4] tpm: Move TPM common base definitions to the command header

From: kernel test robot

Date: Sat Mar 21 2026 - 22:01:23 EST


Hi Alec,

kernel test robot noticed the following build warnings:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus linus/master v7.0-rc4 next-20260320]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Alec-Brown/tpm-Initial-step-to-reorganize-TPM-public-headers/20260322-021741
base: char-misc/char-misc-testing
patch link: https://lore.kernel.org/r/20260317160613.2899129-5-alec.r.brown%40oracle.com
patch subject: [PATCH 4/4] tpm: Move TPM common base definitions to the command header
config: arm-randconfig-r132-20260322 (https://download.01.org/0day-ci/archive/20260322/202603220920.LNzslwgU-lkp@xxxxxxxxx/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260322/202603220920.LNzslwgU-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
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603220920.LNzslwgU-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from drivers/char/tpm/tpm-dev-common.c:19:
In file included from drivers/char/tpm/tpm.h:29:
include/linux/tpm_eventlog.h:167:6: warning: variable 'mapping_size' set but not used [-Wunused-but-set-variable]
167 | int mapping_size;
| ^
In file included from drivers/char/tpm/tpm-dev-common.c:19:
In file included from drivers/char/tpm/tpm.h:28:
In file included from include/linux/tpm.h:28:
>> include/linux/tpm_command.h:517:2: warning: field within 'struct tpm_header' is less aligned than 'union tpm_header::(anonymous at include/linux/tpm_command.h:517:2)' and is usually due to 'struct tpm_header' being packed, which can lead to unaligned accesses [-Wunaligned-access]
517 | union {
| ^
2 warnings generated.
--
In file included from drivers/char/tpm/tpm-buf.c:7:
In file included from include/linux/tpm.h:28:
>> include/linux/tpm_command.h:517:2: warning: field within 'struct tpm_header' is less aligned than 'union tpm_header::(anonymous at include/linux/tpm_command.h:517:2)' and is usually due to 'struct tpm_header' being packed, which can lead to unaligned accesses [-Wunaligned-access]
517 | union {
| ^
1 warning generated.


vim +517 include/linux/tpm_command.h

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

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