From patchwork Fri Nov 10 14:29:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13452707 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EC70C4167D for ; Fri, 10 Nov 2023 19:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235946AbjKJTYv (ORCPT ); Fri, 10 Nov 2023 14:24:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235330AbjKJTYR (ORCPT ); Fri, 10 Nov 2023 14:24:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A3D338EB4; Fri, 10 Nov 2023 06:29:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AA8BC433C7; Fri, 10 Nov 2023 14:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699626596; bh=nLlP5zYhWe9W91LWYdUOANl7JYKJxORxVdmkjcwH0Fs=; h=From:To:Cc:Subject:Date:From; b=qxa3WiwlZU/JYQmPYD4XnuPogZqrblGFEefjgDc/LBLt0n3SAtxDGBwMrw5zi5QeQ /ze1SQmOpav4e+VBgWN97fcnudCWzsL6zaqzYT+SWuUF3Q0ba7KXIhANddvQkKm2VA lj9rGCIVCEGuIej00dRE1LiXkyc4f5OsOeCVM44z1tUXAIVM7laGJOOrDdsnUj8iFD NvjlJt1XfuXm52Zu8yUdBbTZdg8xObKvFgVqPUdLyqZhv3GCTmZxIwQPRp4nXi8rfJ e3KAEvn6G3hX06UVnBv1maxNmFjqvVRrDhSuCPB0jNeNSdMzsDBkm8luHnTiyqWtOj ZK8D1eHHtqdLA== From: Arnd Bergmann To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Kalle Valo , Matthias Brugger , AngeloGioacchino Del Regno , Yi-Chia Hsieh , Peter Chiu , Money Wang , Evelyn Tsai Cc: Arnd Bergmann , Shayne Chen , Sean Wang , Bo Jiao , MeiChia Chiu , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] wifi: mt76: mt7996: fix mt7996_mcu_all_sta_info_event struct packing Date: Fri, 10 Nov 2023 15:29:30 +0100 Message-Id: <20231110142948.3841137-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann The internal struct and union inside mt7996_mcu_all_sta_info_event is marked as being aligned, which conflicts with it being unaligned within that structure: drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2: error: field within 'struct mt7996_mcu_all_sta_info_event' is less aligned than 'union mt7996_mcu_all_sta_info_event::(anonymous at ../drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2)' and is usually due to 'struct mt7996_mcu_all_sta_info_event' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] Mark all three as being packed as well to ensure byte packing for the entire thing. Fixes: adde3eed4a75 ("wifi: mt76: mt7996: Add mcu commands for getting sta tx statistic") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h index a88f6af323da..e20c38f17827 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h @@ -168,15 +168,15 @@ struct mt7996_mcu_all_sta_info_event { u8 rsv[2]; __le32 tx_bytes[IEEE80211_NUM_ACS]; __le32 rx_bytes[IEEE80211_NUM_ACS]; - } adm_stat[0]; + } adm_stat[0] __packed; struct { __le16 wlan_idx; u8 rsv[2]; __le32 tx_msdu_cnt; __le32 rx_msdu_cnt; - } msdu_cnt[0]; - }; + } msdu_cnt[0] __packed; + } __packed; } __packed; enum mt7996_chan_mib_offs {