From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B3BC173 for ; Mon, 17 Jan 2022 10:19:48 +0000 (UTC) Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JcnvP0hVbz67NNV; Mon, 17 Jan 2022 18:19:29 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 11:19:39 +0100 Received: from localhost (10.47.77.46) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 10:19:39 +0000 Date: Mon, 17 Jan 2022 10:19:41 +0000 From: Jonathan Cameron To: kernel test robot CC: Oleksij Rempel , , , , Andy Shevchenko Subject: Re: drivers/iio/adc/ti-tsc2046.c:242:62: warning: taking address of packed member 'data' of class or structure 'tsc2046_adc_atom' may result in an unaligned pointer value Message-ID: <20220117101941.00003c68@Huawei.com> In-Reply-To: <202201171718.7ZCI4YeQ-lkp@intel.com> References: <202201171718.7ZCI4YeQ-lkp@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.77.46] X-ClientProxiedBy: lhreml709-chm.china.huawei.com (10.201.108.58) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected On Mon, 17 Jan 2022 18:00:03 +0800 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 0c947b893d69231a9add855939da7c66237ab44f > commit: 9374e8f5a38defe90bc65b2decf317c1c62d91dd iio: adc: add ADC driver for the TI TSC2046 controller > date: 8 months ago > config: mips-randconfig-r002-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171718.7ZCI4YeQ-lkp@intel.com/config) > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c63a3175c2947e8c1a2d3bbe16a8586600705c54) > 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=9374e8f5a38defe90bc65b2decf317c1c62d91dd > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > git fetch --no-tags linus master > git checkout 9374e8f5a38defe90bc65b2decf317c1c62d91dd > # save the config file to linux build tree > mkdir build_dir > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/iio/adc/ drivers/usb/gadget/ > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > >> drivers/iio/adc/ti-tsc2046.c:242:62: warning: taking address of packed member 'data' of class or structure 'tsc2046_adc_atom' may result in an unaligned pointer value [-Waddress-of-packed-member] > return FIELD_GET(TI_TSC2046_DATA_12BIT, get_unaligned_be16(&buf->data)); > ^~~~~~~~~ I'm open to suggestions on what (if anything) to do about this one... Jonathan > include/linux/bitfield.h:108:27: note: expanded from macro 'FIELD_GET' > __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \ > ^~~~ > include/linux/bitfield.h:52:38: note: expanded from macro '__BF_FIELD_CHECK' > BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \ > ^~~~ > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG' > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^~~~ > include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert' > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > ^~~~~~~~~ > include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert' > __compiletime_assert(condition, msg, prefix, suffix) > ^~~~~~~~~ > include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert' > if (!(condition)) \ > ^~~~~~~~~ > 1 warning generated. > > > vim +242 drivers/iio/adc/ti-tsc2046.c > > 239 > 240 static u16 tsc2046_adc_get_value(struct tsc2046_adc_atom *buf) > 241 { > > 242 return FIELD_GET(TI_TSC2046_DATA_12BIT, get_unaligned_be16(&buf->data)); > 243 } > 244 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4833921607671882347==" MIME-Version: 1.0 From: Jonathan Cameron To: kbuild-all@lists.01.org Subject: Re: drivers/iio/adc/ti-tsc2046.c:242:62: warning: taking address of packed member 'data' of class or structure 'tsc2046_adc_atom' may result in an unaligned pointer value Date: Mon, 17 Jan 2022 10:19:41 +0000 Message-ID: <20220117101941.00003c68@Huawei.com> In-Reply-To: <202201171718.7ZCI4YeQ-lkp@intel.com> List-Id: --===============4833921607671882347== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon, 17 Jan 2022 18:00:03 +0800 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t master > head: 0c947b893d69231a9add855939da7c66237ab44f > commit: 9374e8f5a38defe90bc65b2decf317c1c62d91dd iio: adc: add ADC driver= for the TI TSC2046 controller > date: 8 months ago > config: mips-randconfig-r002-20220116 (https://download.01.org/0day-ci/ar= chive/20220117/202201171718.7ZCI4YeQ-lkp(a)intel.com/config) > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c63a= 3175c2947e8c1a2d3bbe16a8586600705c54) > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/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=3D9374e8f5a38defe90bc65b2decf317c1c62d91dd > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/= git/torvalds/linux.git > git fetch --no-tags linus master > git checkout 9374e8f5a38defe90bc65b2decf317c1c62d91dd > # save the config file to linux build tree > mkdir build_dir > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W= =3D1 O=3Dbuild_dir ARCH=3Dmips SHELL=3D/bin/bash drivers/iio/adc/ drivers/u= sb/gadget/ > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All warnings (new ones prefixed by >>): > = > >> drivers/iio/adc/ti-tsc2046.c:242:62: warning: taking address of packed= member 'data' of class or structure 'tsc2046_adc_atom' may result in an un= aligned pointer value [-Waddress-of-packed-member] = > return FIELD_GET(TI_TSC2046_DATA_12BIT, get_unaligned_be16(&bu= f->data)); > ^~= ~~~~~~~ I'm open to suggestions on what (if anything) to do about this one... Jonathan > include/linux/bitfield.h:108:27: note: expanded from macro 'FIELD_GET' > __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); = \ > ^~~~ > include/linux/bitfield.h:52:38: note: expanded from macro '__BF_FIELD_= CHECK' > BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, = \ > ^~~~ > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_= ON_MSG' > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^~~~ > include/linux/compiler_types.h:328:22: note: expanded from macro 'comp= iletime_assert' > _compiletime_assert(condition, msg, __compiletime_assert_, __C= OUNTER__) > ^~~~~~~~~ > include/linux/compiler_types.h:316:23: note: expanded from macro '_com= piletime_assert' > __compiletime_assert(condition, msg, prefix, suffix) > ^~~~~~~~~ > include/linux/compiler_types.h:308:9: note: expanded from macro '__com= piletime_assert' > if (!(condition)) = \ > ^~~~~~~~~ > 1 warning generated. > = > = > vim +242 drivers/iio/adc/ti-tsc2046.c > = > 239 = > 240 static u16 tsc2046_adc_get_value(struct tsc2046_adc_atom *buf) > 241 { > > 242 return FIELD_GET(TI_TSC2046_DATA_12BIT, get_unaligned_be16(&buf->= data)); = > 243 } > 244 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============4833921607671882347==--