From nobody Wed Feb 16 20:26:29 2022 X-Original-To: dev-commits-src-branches@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 661A919BC72B; Wed, 16 Feb 2022 20:26:30 +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 4JzTxx52yLz3Lfm; Wed, 16 Feb 2022 20:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645043189; 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=lfjwzgdXFnaRbcnAJGZzvWGn2ROeCoK6tw47G2HTJ/E=; b=BnkqnoGplloUbZaTKrwroZ3lBEcV+3AXw+PhtnsCo9vlRfiotDvIxqctWAuu3yt0mi1KES HG1uUOGtIWLhhE7n/6OGJe05U8ttnJDs6wCKMCrSP1WmGdcL2nJinyBCs4O+/53FWPcTs9 Ndq93JL6Qo+OW8nwO0VbCLgzbsk2sL4OGupdOvU3skd0Y8noyLNGb9HgOYu/KdjGAN2dNE 8ySOIWSOjYgbQ3ylPIy11KiQ9gjrM1d9ST8PRuXLL9i9PxcxzArLaNQxoE1nrVxrOvfZze 9P2f+2iS5SCsMf7BhKHTLFAB4eCh5svavdfcLT8YfU64oiLjDnaTOSmS5l5flA== 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 5EBA11CB29; Wed, 16 Feb 2022 20:26:29 +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 21GKQTVH051630; Wed, 16 Feb 2022 20:26:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21GKQTwM051629; Wed, 16 Feb 2022 20:26:29 GMT (envelope-from git) Date: Wed, 16 Feb 2022 20:26:29 GMT Message-Id: <202202162026.21GKQTwM051629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 97b0011c8094 - stable/12 - bwi: Fix clang 14 warning about possible unaligned access List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 97b0011c809433cd2c32abb177b17fb08979cc69 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645043189; 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=lfjwzgdXFnaRbcnAJGZzvWGn2ROeCoK6tw47G2HTJ/E=; b=H4ZpKcjxRggUE0dteF2ADj2i4p2HMjffZulN31+Pm995j/6jxqoV4iFLoNK6X9Rzq153DE tnNFB/FOuC1LhYqjWXwgfP2WwmanZPXTE+AiepgmiBA83miQOc/AcB7iT/lhdkZFT7t0oG I4WkxdwdulmS/aBUjZsPboTOq/ApyhzqCYf/rrPLXovWTb8Btmga6r7DOKmOFJmwtfuGht N1M3VOTMoUSO4645nBXd6SOeORmUjh6kPKTO0Mc/hJnhikUdgr2v4waiOtzY/knhpKW9GI Lq/dpEsW/lsIkMJJOFV+O1VSxHgeyDDOmi6hoXnQZJ1SA5wPjr71yQ6RK6VOsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645043189; a=rsa-sha256; cv=none; b=dAEgbRpornKOQFraWPB5FB07tQ2xen0R1d7Yx7jBR3yxClnrQ2YM+Tq9UTAfeoN7WjYVP0 X0EkaztVFvKYS6YiZCr+ze8EyaJFo9aja3VfpOVcGKCBCRjKTlBVGupkBY18rqQhPqC1ec pkotaLFn3uFwCAJ4CwDOu8SPe8orKOkohwdoOeRDhdHOzaafPwRmkf6CCkrblz6cEu4kft 9N02XyqtYvSH8RtKrCxj8dWVucNjxuo0ajNk/qWcOILfRD2cfHysSuicoqjEEZwaVNftBz rxcUTPzlhgRuKCx1X/nOUVCW2eMG7ppfdytE8QPAP3WepfpD7UqeEK80i6PQZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=97b0011c809433cd2c32abb177b17fb08979cc69 commit 97b0011c809433cd2c32abb177b17fb08979cc69 Author: Dimitry Andric AuthorDate: 2022-02-07 20:59:46 +0000 Commit: Dimitry Andric CommitDate: 2022-02-16 20:25:26 +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 (cherry picked from commit 09d0a0fbe859e3fc7bbff0cf48c389b5e55b9e00) --- 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)