From patchwork Mon May 15 19:25:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 13242131 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49A8018C34 for ; Mon, 15 May 2023 19:24:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54CDAC433D2; Mon, 15 May 2023 19:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684178691; bh=C4wXwE3SPYYJ5PgdOQEua70Xotse/PA3G9oTdV89q3o=; h=Date:From:To:Cc:Subject:From; b=KvDlSowej9w11xUBHag2aqhuCFCP0F3u4EfeKILBNNsqpIcU0dccNWO71WMmo3ylV 3pRRZ6+nWsFdzLcyeUSSdtoaY2XVtf92vBREFxb0drolV19E++uxYdBbxBe8tZ569N pvvf+J0rz9lmAqsPaFsGJqxmusFzNE4/WSP+PRbRUfvDjuqFsJqyBP8Bgiq+KaZ+N2 8og8sVCcwNjLRx+9VEZcNx0NEonYI6dsjO8m+VoI8GvtW6WpWfwg6pyBfPXMIoX90D 1/Trv+ggdmK9DxOqrp4dPgMi3VIsnkZSus9RLioTbQxXGhhG9fyKxe9bWmOSiqOxSj rfjgSMIsZKVlw== Date: Mon, 15 May 2023 13:25:39 -0600 From: "Gustavo A. R. Silva" To: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] wifi: wil6210: wmi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Message-ID: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Patchwork-Delegate: kuba@kernel.org Zero-length arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members alone in structs. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/288 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman Reviewed-by: Kees Cook --- drivers/net/wireless/ath/wil6210/wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h index 9affa4525609..71bf2ae27a98 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.h +++ b/drivers/net/wireless/ath/wil6210/wmi.h @@ -2763,7 +2763,7 @@ struct wmi_rf_xpm_write_result_event { /* WMI_TX_MGMT_PACKET_EVENTID */ struct wmi_tx_mgmt_packet_event { - u8 payload[0]; + DECLARE_FLEX_ARRAY(u8, payload); } __packed; /* WMI_RX_MGMT_PACKET_EVENTID */