Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1347495pxb; Fri, 21 Jan 2022 16:07:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnAiKrV7fX3co2F2YATVVieF2QS10Y5UcnIfQpbt6ku+5TFx7yw9TsHDLxSBMoZAfqE5EZ X-Received: by 2002:a17:90a:9104:: with SMTP id k4mr2996546pjo.87.1642810041296; Fri, 21 Jan 2022 16:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642810041; cv=none; d=google.com; s=arc-20160816; b=BDVtx2fPVyZX5ghKxd0Q55D7Zjikh/ayUPO7H4II9L/6QM3i8ivAc0neTCMxtxcj8f lRPSaR0rtKwPOl1mxtkTJfEAGn2iMtJtou3KYs5G3gzGt/Vrgtjj/zysPLw74oJ0lmiV cp7+bt6A9KcOUd+GSn8d5+ZNdEcQ75G0BIE8M22tIAj6+TK5l5M0I1vNFBOTPiyw02zW LtS+9z9W2l+uQoaYowJvkot+grLSVVSQ5QotjL+QJoBBvBqvGLuKdPyjq9MzUZwTvxri IgmHDgmO4UFSDW5zj6KbBseemSwno7Xh5PaXbWUIsWjXVxcffq1jMRrcqA+Cj8+HToip 61kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eJk9H7BjDdqUwpOOqdCY/FPHAl1KkKutss0tKUJ3bEI=; b=CQoyM+qTMp8u5ZTFP9fy1DOKZf6DSk/F5Ng9NOyoFfM/SsLbtTHd43Xuk5BqHAevUf aBfwKQrf7I31+pUWvZQ4DkXwBsf3mZE600bn13X9ppRvuxANSma4S0fKdz3Xg21XN5GB 1A4Gz4/0/6DpLLo9pXNJohrt0FfSYpEpovNZdGtWmcpAzRxp9NIu2jLckXUH3BZSwteH d8KFvhl89EGKBR9Us81xOiEWpBuPQe1/b8VedBxeJ/eD/Hh3IFD1C2apu3rNuxIPO35a AGz5PhakF/01ydPtFHEtt49EZCLNgM7oTbApPY5kqSuQnEwdAZk+jMsi3um1FTZYig9L EilQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mu3K0U61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si7173144plv.614.2022.01.21.16.07.09; Fri, 21 Jan 2022 16:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mu3K0U61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347494AbiATVo4 (ORCPT + 99 others); Thu, 20 Jan 2022 16:44:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbiATVoy (ORCPT ); Thu, 20 Jan 2022 16:44:54 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12FBAC061574 for ; Thu, 20 Jan 2022 13:44:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8FC0B81E54 for ; Thu, 20 Jan 2022 21:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CBABC340E0; Thu, 20 Jan 2022 21:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642715091; bh=FZe+SAxvQtqmayyXIEIlIPrLP6I5xnrdSTWqJ4EPxLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mu3K0U614ZhC262qaahxQtHOBYM9LjQHb1h83zQ0n6vovlWum9+Mx2ukRl7mOHR4j 0oDT+BipsYz6Nt2thKg0EAeaFtz4A4TfvgTsoDQ1k2gfiLKJllRaHImWWdeIIm/iXO 2svOrq97+mt8krHLcTYHrzALygRIA8O5CiZpd1WK0BEhuvu4mY+LFEUj8nv8c8Wxkf gwZv769Owh0tb+4lHk1XfhhppDvBPoq6/oD+mu8aXUkoKr1lOk2LihpkoOllVwbdF8 p8bEzgIYLmIdwkDlgtEz/bilVo36N5qQ7fHus1t+0eX3H6ozvE45APjLJ6uVuN0AmG QGPRpEst2CU2A== Date: Thu, 20 Jan 2022 14:44:47 -0700 From: Nathan Chancellor To: Jonathan Cameron Cc: kernel test robot , Oleksij Rempel , llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, 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: References: <202201171718.7ZCI4YeQ-lkp@intel.com> <20220117101941.00003c68@Huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220117101941.00003c68@Huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 10:19:41AM +0000, Jonathan Cameron wrote: > 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... Hi Jonathan, -Waddress-of-packed-member is disabled in the main Makefile and this particular randconfig has a bunch of these warnings. It comes from the fact that arch/mips/loongson64/Platform adds -mno-branch-likely unconditionally but clang does not support it so it issues a warning: clang-14: warning: argument unused during compilation: '-mno-branch-likely' [-Wunused-command-line-argument] The presence of this warning causes cascading cc-option failures because cc-option adds -Werror, which means that the requested flag never gets added to KBUILD_CFLAGS, so we see instances of warnings that should be disabled. This has come up in the past because clang has four different ways it can react to a flag it does not recognize. One is an error, the other three are warnings. We handle two in scripts/Makefile.clang to try and make these failures more obvious in the build but we do not handle this warning because there are instances of it in arch/arm [1]. I'll push to get that change into mainline so we can avoid this once and for all. More background: * 589834b3a009 ("kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS") * 0664684e1ebd ("kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS") For now, I have sent [2]. It might be nice to clean the kernel up of these warnings over time (and I recall seeing a patch fly by recently [3]) but I don't think there is much for you to do now. [1]: https://lore.kernel.org/r/20210928154143.2106903-14-arnd@kernel.org/ [2]: https://lore.kernel.org/r/20220120214001.1879469-2-nathan@kernel.org/ [3]: https://lore.kernel.org/r/20220110224656.266536-1-sakari.ailus@linux.intel.com/ Cheers, Nathan