From nobody Sun Feb 13 13:36:51 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 07FEF19C4409; Sun, 13 Feb 2022 13:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JxT0g6mzdz3Q49; Sun, 13 Feb 2022 13:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644759412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soJDhmZs+3CB3amXLY/zffL0g4w4r58FugDF+bkBXMg=; b=t0oQVHFzrPSxNq4XT3iE932yCCPmxZo651ESaSGnGrtKyjNx4pfnBkDIQu/DTimkkonHpj yXR5FyUwXxwTfwzRZGfY5CT+fWbYa43PiqwuKkIJYVydkL4S2929BusqYTJNRZ7SPH/xBG UJAxq/jTw3uIhQRpG09eOzS/jlTkGG7x4Ahj4dMh+u9XPxXoGegT84g5hkui76E49sFjMn 0gUD6MzHo54lVjtT5dIbdFqCbk7Ff06F8BG44v6+51gHJFbGQr0NAKINxEhG7+r/dIy9Jy cV8KGCxpTqeblArWn4+Ygdrgy8XLs6E4/PZ9vtC0bVA4QsK63X0bP2wAfxJ+ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B58221C0A9; Sun, 13 Feb 2022 13:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21DDapVE014082; Sun, 13 Feb 2022 13:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21DDapFF014081; Sun, 13 Feb 2022 13:36:51 GMT (envelope-from git) Date: Sun, 13 Feb 2022 13:36:51 GMT Message-Id: <202202131336.21DDapFF014081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 09d0a0fbe859 - main - bwi: Fix clang 14 warning about possible unaligned access List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09d0a0fbe859e3fc7bbff0cf48c389b5e55b9e00 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644759412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soJDhmZs+3CB3amXLY/zffL0g4w4r58FugDF+bkBXMg=; b=d/ZA+twF5Eg2IZ1z7l1HkLCG4v4YznG0/ZHi2CnqJrl8Sebve87HOvtvjre+TL/8gO5bH4 ZqMJJJOe+2W6HnSZEerD9qRD0iodFbefeM7g3YGRLX0goqCzitppJ8UmF1Evgc1v54coKO 9t5KOo+X12lCbN85RnWEbF/fFhsK1CpAVAigOrf+B1RUx9oiyV/KfVp7QLsyWZMmQQCso2 3CYaIcNMVHl+ar437XVXT3QxBtnd6VtVcHOa7RxkzAe8WnqblE8kxldsPzUBFX99yQC5wR pEMBC74jIDww5QzQDemJFZSVV13IGchlD0bV965PasyRQVav99wGH+h1B+ZeDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644759412; a=rsa-sha256; cv=none; b=dJ+okP6WYrIRLUQZr5AqrhoV67UmvlO7VDyxtlhewRpjH7kixhcokp2eOxs5ee3l7aLfrl c0NNex1nY3MfNyg0BI6jgHvgZ1R2JmLZv9i45QMnCHjM5/ITkZjlaZ+4sCd1UWjeyzOn54 3+mwuiyL5p57+eYAbIcG9uzGUpvgAMlqYIz45Jb4bItNn3DLLvR+Un5fC01FE2tbbwJZ8P 9wXJ4Z0w5k+vwmjP5UljF3ns2uVre027e4sDGbZYsm7oYy/B+SOBPGEA3m0R7w7aSIY7Lj xlmJ8+c/aBrX5h7Sgg3Y3Is87SxAj4TTskKKQAez6cCM9ZAge1+IPRW6n2VQQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=09d0a0fbe859e3fc7bbff0cf48c389b5e55b9e00 commit 09d0a0fbe859e3fc7bbff0cf48c389b5e55b9e00 Author: Dimitry Andric AuthorDate: 2022-02-07 20:59:46 +0000 Commit: Dimitry Andric CommitDate: 2022-02-13 13:35:58 +0000 bwi: Fix clang 14 warning about possible unaligned access On architectures with strict alignment requirements (e.g. arm), clang 14 warns about a packed struct which encloses a non-packed union: In file included from sys/dev/bwi/bwimac.c:79: sys/dev/bwi/if_bwivar.h:308:7: error: field iv_val within 'struct bwi_fw_iv' is less aligned than 'union (unnamed union at sys/dev/bwi/if_bwivar.h:305:2)' and is usually due to 'struct bwi_fw_iv' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] } iv_val; ^ It appears to help if you also add __packed to the inner union (i.e. iv_val). No change to the layout is intended. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D34196 --- sys/dev/bwi/if_bwivar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bwi/if_bwivar.h b/sys/dev/bwi/if_bwivar.h index 90b4aeab6d26..9961cfca9193 100644 --- a/sys/dev/bwi/if_bwivar.h +++ b/sys/dev/bwi/if_bwivar.h @@ -305,7 +305,7 @@ struct bwi_fw_iv { union { uint32_t val32; uint16_t val16; - } iv_val; + } __packed iv_val; } __packed; #define BWI_FW_IV_OFS_MASK __BITS(14, 0)