drivers/input/touchscreen/ads7846.c:705:24: warning: taking address of packed member 'data' of class or structure 'ads7846_buf' may result in an unaligned pointer value
From: kernel test robot
Date: Thu Jul 01 2021 - 15:22:00 EST
Hi Oleksij,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dbe69e43372212527abf48609aba7fc39a6daa27
commit: 6965eece2a89c3f1d00881c6052ee1e987870c08 Input: ads7846 - convert to one message
date: 5 months ago
config: mips-buildonly-randconfig-r005-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d21d5472501460933e78aead04cf59579025ba4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6965eece2a89c3f1d00881c6052ee1e987870c08
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6965eece2a89c3f1d00881c6052ee1e987870c08
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
>> drivers/input/touchscreen/ads7846.c:705:24: warning: taking address of packed member 'data' of class or structure 'ads7846_buf' may result in an unaligned pointer value [-Waddress-of-packed-member]
value = be16_to_cpup(&buf->data);
^~~~~~~~~
1 warning generated.
vim +705 drivers/input/touchscreen/ads7846.c
700
701 static int ads7846_get_value(struct ads7846_buf *buf)
702 {
703 int value;
704
> 705 value = be16_to_cpup(&buf->data);
706
707 /* enforce ADC output is 12 bits width */
708 return (value >> 3) & 0xfff;
709 }
710
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip