Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp410956iob; Wed, 18 May 2022 05:04:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIUmFbmOgtAc04Id6qCT4BD8NPF98RK6p2ebMFEnojH4eYYlz4AlYmvxCg5sjDpW6uE2+J X-Received: by 2002:a17:902:ea53:b0:15b:1bb8:ac9e with SMTP id r19-20020a170902ea5300b0015b1bb8ac9emr26547301plg.45.1652875468215; Wed, 18 May 2022 05:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652875468; cv=none; d=google.com; s=arc-20160816; b=YUGbzUvOHS+dtOH1x5s7hjjpXQ9DTXBgXaqMKaZaDnaHofGfpqI/9GA3j6jerKLKhj 2UCZSJXIY8fe+PCIATcgKDaqNps5+2LGLIk7lwVwqqrc6bBOFtD7NXrThGYWxx67knoh OXA0IWSP/01kmJkogmJ9E3K5Ze4glFIbQjUMdsgsn9byTLUJBKPW6S3oodYpJfyFHoKH ErSPQ7WNAr1o8WCarJWFvXwFMskcomHMv1dniJuvFwS641ar7iDwzNlMcqgpSL3iF9aS SPTic4op/8iglzQ6P0xitbbuJ3DJrkTpyEC5j+RajN/ZMv0lDrsdRDcpZiQ4/1Dm4Hax VDQw== 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=GSQitcfkZFa0FKegC/Bkt9v8dAnoboxTJTV/W5xKBGQ=; b=AtPbXZoDeCwhTwrtEbsk+K73snVUnwzzMaEh7tiOWRaRkrAwnekejGY6BlpkYbUnDw aw5FpiofntJFyKF7sV3cn68kdqddEgxpiyOi/ZYtUAqm1J8XgETHjAyU9++/2uozfAX0 GCC98gfOiJS29P41tAQZILPtqKetGRv8LScOg63+FTQ7BQZrIhdMav0VmsifCReV1KKG l0JOHXIP158Xb+7YLJHRvSCa2cA5dHL9wfQaC9C4xnOvSRLMSf1v8LlQ0tHj3C9q1OeI jpSVf1X9gHCIxvhK9ciVz40V8k43JwRWJH7UQraVqRBFi/jEr6LmlGed4asv0QSrjStE Gh3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bx2-20020a17090af48200b001d291084911si5950320pjb.151.2022.05.18.05.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 05:04:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 082F262BD4; Wed, 18 May 2022 04:58:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235965AbiERL6g (ORCPT + 99 others); Wed, 18 May 2022 07:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235953AbiERL6e (ORCPT ); Wed, 18 May 2022 07:58: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 9D6684A3D9 for ; Wed, 18 May 2022 04:58: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 1nrIJr-0001Di-BI; Wed, 18 May 2022 13:58:23 +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 E451F8134B; Wed, 18 May 2022 11:58:20 +0000 (UTC) Date: Wed, 18 May 2022 13:58:20 +0200 From: Marc Kleine-Budde To: Vincent Mailhol Cc: kernel test robot , llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org Subject: Re: [PATCH] can: mcp251xfd: silence clang's -Wunaligned-access warning Message-ID: <20220518115820.qzvyrnwsb4wvayq2@pengutronix.de> References: <20220518070517.q53bjzo6lbnq3f2i@pengutronix.de> <20220518114357.55452-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="57rj3wezavrbut5g" Content-Disposition: inline In-Reply-To: <20220518114357.55452-1-mailhol.vincent@wanadoo.fr> 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 --57rj3wezavrbut5g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 18.05.2022 20:43:57, Vincent Mailhol wrote: > clang emits a -Wunaligned-access warning on union > mcp251xfd_tx_ojb_load_buf. >=20 > The reason is that field hw_tx_obj (not declared as packed) is being > packed right after a 16 bits field inside a packed struct: >=20 > | union mcp251xfd_tx_obj_load_buf { > | struct __packed { > | struct mcp251xfd_buf_cmd cmd; > | /* ^ 16 bits fields */ > | struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > | /* ^ not declared as packed */ > | } nocrc; > | struct __packed { > | struct mcp251xfd_buf_cmd_crc cmd; > | struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; > | __be16 crc; > | } crc; > | } ____cacheline_aligned; >=20 > Starting from LLVM 14, having an unpacked struct nested in a packed > struct triggers a warning. c.f. [1]. >=20 > This is a false positive because the field is always being accessed > with the relevant put_unaligned_*() function. Adding __packed to the > structure declaration silences the warning. >=20 > [1] https://github.com/llvm/llvm-project/issues/55520 >=20 > Signed-off-by: Vincent Mailhol Thank! Applies to linux-can-next/testing. regards, 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 | --57rj3wezavrbut5g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmKE31kACgkQrX5LkNig 011t0ggAq8G16P8sCd0leKEHsfIg71a0qsHV2KuL4mFSOedd48EPrhnA0jsvaIF8 byxhVqb5H/VjWWQ6y4x3e0AGfj3h/3c7PZJL/P6K77Hq2frEkepTGtzLd7Lp/UWC uXy2m+tC3C8Emd8z2mLw0sH6bdgkZ4vtQjEPy1oHWTxPcSp1LRnAwXt8iS+ReVhA pp8J8k3ctN8KJdfisVRScLINFYa5dGDpbrFjLQCDkan+S1TubuqwgvIghP5V6Stb ilB9OFEcDh8BSqiId9YhQsocIf3z6akzTfZWBA6Vd9vxl/1VkNbm09A9u0onIfBv mQlJi8sA48p9WMrNmj9E6Ech2dnnVA== =lBes -----END PGP SIGNATURE----- --57rj3wezavrbut5g--