Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp221895iob; Wed, 18 May 2022 00:16:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjwa5zaqQnqf5XTryRJoN5jDKQaPN8TCj4ADLzIn91kp8GPI9YPxXt75n21kfn4cpGddB9 X-Received: by 2002:a17:90a:5215:b0:1ca:79cf:f3dd with SMTP id v21-20020a17090a521500b001ca79cff3ddmr29080741pjh.6.1652858179153; Wed, 18 May 2022 00:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652858179; cv=none; d=google.com; s=arc-20160816; b=E9HNiiYeM4xWogrO3e7wmYJRnhFfufNnrpadrqp4M7Cd0AvzO2hDtQL589LALLLXyB CeTdWvUXKYJPSRjzKAn0ObsmGe6L10SW6nVsesOXwSi9qZPidJLBFYSMTbR2t37Vsz9k 5GMvFnrI7MS8rCUXUYOium8zkCpmbH5CmOkJjFDysw+KMVD1i9tllCPdAfiG6AMX81dj RRa6tIVHB+bPC4+fgD/kr952XIGuKOJqjE0/ERf6tbczloRuMHnjQtOdL47C/giWym3x tAEYewRLhoTSSjTpURWkBFhcn6AS9aVpipFT2/XAeb04gssToH0mKu0IA5q9hMv1fZHq g3/g== 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; bh=0aTh7IGUY56xK/KI+eF/aPJtC2u9E6Xro2hKHhGfJ3E=; b=AvR+MsEsAaRGh1KCOzSZah3Qn7jcNVCZR7jz/hjbxnxoCDXl8PfBqL60QOAhkSbpZE wvglklrssMYQqe+cGh/AQ2XobmrAFUIeCF1EHvTrdrYPZutyYHYwKEFepTZgL02DofPJ QjX0GblILTYf/TpQdI9BMnAF8ptmPI7t48b9k9IaGrwrSwhZn6Ibv+D4wuN6D3lOsK91 RPfr8VFlCZtOcu6tQDULaaNQOwMV2NNuvwEjY8xwWWlRvIlwHDiro/Gf7SjRepoHCh2Z 0eRkcQEa0iqIAKv9V1ehyCN0m6GKI6JE9IfuZRU4Rs7EVGTpGjHKpSMoH2KoEnBHJkWA X/tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b67-20020a633446000000b003f5f9d7e7d7si1551736pga.272.2022.05.18.00.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 00:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB61313F63; Wed, 18 May 2022 00:05:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbiERHFg (ORCPT + 99 others); Wed, 18 May 2022 03:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231875AbiERHFe (ORCPT ); Wed, 18 May 2022 03:05:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B977CA308F for ; Wed, 18 May 2022 00:05:32 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrDkF-0000CF-AS; Wed, 18 May 2022 09:05:19 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 1EB3B80F3A; Wed, 18 May 2022 07:05:18 +0000 (UTC) Date: Wed, 18 May 2022 09:05:17 +0200 From: Marc Kleine-Budde To: kernel test robot Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org Subject: Re: drivers/net/can/spi/mcp251xfd/mcp251xfd.h:481:34: warning: field hw_tx_obj within 'struct mcp251xfd_tx_obj_load_buf::(unnamed at drivers/net/can/spi/mcp251xfd/mcp251xfd.h:479:2)' is less aligned than 'struct mcp251xfd_hw_tx_obj_raw' and is usually due to ... Message-ID: <20220518070517.q53bjzo6lbnq3f2i@pengutronix.de> References: <202205181414.n8QRDe8k-lkp@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cujgf6c2mizwls7v" Content-Disposition: inline In-Reply-To: <202205181414.n8QRDe8k-lkp@intel.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cujgf6c2mizwls7v Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 18.05.2022 14:45:33, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t master > head: 210e04ff768142b96452030c4c2627512b30ad95 > commit: eb79a267c9b3e608e7762a1b221428f37ace3aa3 can: mcp251xfd: rename a= ll remaining occurrence to mcp251xfd > date: 1 year, 8 months ago > config: arm-randconfig-c002-20220518 (https://download.01.org/0day-ci/arc= hive/20220518/202205181414.n8QRDe8k-lkp@intel.com/config) > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 853f= a8ee225edf2d0de94b0dcbd31bea916e825e) > 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 arm cross compiling tool for clang build > # apt-get install binutils-arm-linux-gnueabi > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.= git/commit/?id=3Deb79a267c9b3e608e7762a1b221428f37ace3aa3 > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/= git/torvalds/linux.git > git fetch --no-tags linus master > git checkout eb79a267c9b3e608e7762a1b221428f37ace3aa3 > # save the config file > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross=20 >=20 > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot >=20 > All warnings (new ones prefixed by >>): >=20 > >> drivers/net/can/spi/mcp251xfd/mcp251xfd.h:481:34: warning: field hw_tx= _obj within 'struct mcp251xfd_tx_obj_load_buf::(unnamed at drivers/net/can/= spi/mcp251xfd/mcp251xfd.h:479:2)' is less aligned than 'struct mcp251xfd_hw= _tx_obj_raw' and is usually due to 'struct mcp251xfd_tx_obj_load_buf::(unna= med at drivers/net/can/spi/mcp251xfd/mcp251xfd.h:479:2)' being packed, whic= h can lead to unaligned accesses [-Wunaligned-access] > struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > ^ > drivers/net/can/spi/mcp251xfd/mcp251xfd.h:485:34: warning: field hw_tx= _obj within 'struct mcp251xfd_tx_obj_load_buf::(unnamed at drivers/net/can/= spi/mcp251xfd/mcp251xfd.h:483:2)' is less aligned than 'struct mcp251xfd_hw= _tx_obj_raw' and is usually due to 'struct mcp251xfd_tx_obj_load_buf::(unna= med at drivers/net/can/spi/mcp251xfd/mcp251xfd.h:483:2)' being packed, whic= h can lead to unaligned accesses [-Wunaligned-access] > struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > ^ > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:511:1: warning: unused = function 'mcp251xfd_chip_set_mode_nowait' [-Wunused-function] > mcp251xfd_chip_set_mode_nowait(const struct mcp251xfd_priv *priv, > ^ > 3 warnings generated. > -- > >> drivers/net/can/spi/mcp251xfd/mcp251xfd.h:481:34: warning: field hw_tx= _obj within 'struct mcp251xfd_tx_obj_load_buf::(unnamed at drivers/net/can/= spi/mcp251xfd/mcp251xfd.h:479:2)' is less aligned than 'struct mcp251xfd_hw= _tx_obj_raw' and is usually due to 'struct mcp251xfd_tx_obj_load_buf::(unna= med at drivers/net/can/spi/mcp251xfd/mcp251xfd.h:479:2)' being packed, whic= h can lead to unaligned accesses [-Wunaligned-access] > struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > ^ > drivers/net/can/spi/mcp251xfd/mcp251xfd.h:485:34: warning: field hw_tx= _obj within 'struct mcp251xfd_tx_obj_load_buf::(unnamed at drivers/net/can/= spi/mcp251xfd/mcp251xfd.h:483:2)' is less aligned than 'struct mcp251xfd_hw= _tx_obj_raw' and is usually due to 'struct mcp251xfd_tx_obj_load_buf::(unna= med at drivers/net/can/spi/mcp251xfd/mcp251xfd.h:483:2)' being packed, whic= h can lead to unaligned accesses [-Wunaligned-access] > struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > ^ > 2 warnings generated. >=20 >=20 > vim +481 drivers/net/can/spi/mcp251xfd/mcp251xfd.h >=20 > 477=09 > 478 union mcp251xfd_tx_obj_load_buf { > 479 struct __packed { > 480 struct mcp251xfd_buf_cmd cmd; > > 481 struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > 482 } nocrc; > 483 struct __packed { > 484 struct mcp251xfd_buf_cmd_crc cmd; > 485 struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > 486 __be16 crc; > 487 } crc; > 488 } ____cacheline_aligned; > 489 The structure layout is intentional as it describes the hardware messages on the SPI bus. The functions accessing these structs use appropriate put_unaligned_*() functions. How to properly annotate these structs to silence the warnings? Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --cujgf6c2mizwls7v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmKEmqsACgkQrX5LkNig 010wJAf/chPXIiNCGy6KFLiLZz5cZUSKN6WyTQN1q4bmbJppDkFfg+dEjoMedGWL KPH0TdZ9AtWFRFDZzmGrPgBVcnoXD0Hi7Hb1ISIJFZjf7XBDXvePoFY0+6JikS6w AwbMsLZMHBByU9kMOz5NobPyBDaWKcc78dLZARD+vrHhwzQ5C8mITuHHGeQU995N Q83dbx/7dqK6DIfM4draFFYetB4UWmaUS3aBDs0SB7+hX4+8ts9KHdlCm0k/7FXU 607UgLU7Lukwxprd3lGf54HEDAt2fazhseZri8rIaXKOznpjLSOvt0PNUvsQrAEh 5HqZC4V3MqeqIurSCde5uCv2B9sgww== =THh8 -----END PGP SIGNATURE----- --cujgf6c2mizwls7v--