From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48B86C43381 for ; Fri, 5 Feb 2021 09:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1235964F38 for ; Fri, 5 Feb 2021 09:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230126AbhBEJMJ (ORCPT ); Fri, 5 Feb 2021 04:12:09 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:43746 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230111AbhBEJHf (ORCPT ); Fri, 5 Feb 2021 04:07:35 -0500 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l7x4i-0044i1-5T; Fri, 05 Feb 2021 11:06:48 +0200 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Fri, 5 Feb 2021 11:06:33 +0200 Message-Id: X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205090642.1553849-1-luca@coelho.fi> References: <20210205090642.1553849-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [RESEND PATCH 03/12] iwlwifi: fw api: make hdr a zero-size array again Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg In struct iwl_tx_cmd, there's no risk (as Arnd implied) that we might access this as an array, as it's really not an array and cannot be - there's only a single 802.11 header per frame. The only reason for this member is for being able to access it a bit more nicely. On the other hand, this structure is used as a sub-struct in a few places, and then some compilers (e.g. clang with certain options) complain as you shouldn't have structs with variable- length fields embedded in other structs. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/fw/api/tx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h index 644ced53160a..95038b1a8c6f 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h @@ -238,7 +238,7 @@ struct iwl_tx_cmd { __le16 pm_frame_timeout; __le16 reserved4; u8 payload[0]; - struct ieee80211_hdr hdr[]; + struct ieee80211_hdr hdr[0]; } __packed; /* TX_CMD_API_S_VER_6 */ struct iwl_dram_sec_info { -- 2.30.0