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: 94316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp7152952vqo; Mon, 15 May 2023 12:47:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IBWvga9KI95wUr+TGxFJ13VbToMmnetZabpCwXJU8dDkSwloMLYoUQ0rGtqEiwU4lq+9o X-Received: by 2002:a05:6a20:6a27:b0:101:7703:3376 with SMTP id p39-20020a056a206a2700b0010177033376mr25523561pzk.4.1684180045493; Mon, 15 May 2023 12:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684180045; cv=none; d=google.com; s=arc-20160816; b=UjkWUH0Ut3wKm8aoa2uzc0nsdju1wG1CHUzOqoBIJ2m6NCIOKoRS1rGwxNKsPM6StC nT78eR0TswFzBw3OdkSMkJ9UWiPflB9zS/k6ylEEn0Ad5RlX49H+pB+Ywb8xj28ZYi2B PS17/3T2PNIWDz+6/ulxMTS93RxIvy7xO8VPR9UIWQn0GYD2Xe9wYHFH0HV1XBLcKu3p 7HJAT+3cG1HdNSvcYfpdRE7kXfAtiDhbboAB3WLbdGBdkSe1JzHvLnSjcu5PdPnwCwh5 frZn2KTDXN3Im6v9bgXpaMqcVVW6CW1MdgzgISZwjFsJrT1W1dYO7rHrFFxwf91pKc/y N2jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=HkIPeYzaCNqtQdR0g6O8RkIIbT6+14oBjX6Zr7PS7yo=; b=DCAhman1NZQMJIQt8JanuDctpHk4cWqEGxiodx4gbQTHVAiuuW+5rTDieFi1xDLN80 uLDFPM2xjFqegwiDtvBmLqS3c/flBw9UNUbIKx7Mp4EMNctcurccLdO9XWGO9RhY36cN WGkkbUbK7P8ZnxfWDygrdDUpjNd+Dxa2ug3oWhceqC4oCNoQe+J1DWJWD2+VgSCKubVr TFW1Ub8JUJeEtlhTH4jYLr+bnd69/QuGrCsaV/Hj+KmHxnciDEXfYI4lCtKh6A0dDx+M c/jSHZLVl+BTBIfMe14Iarcgub6N9aVUB39L55tTyGTrve6pnYy+Qg8+ZkFA3+OS1r+n TYzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KvDlSowe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t69-20020a637848000000b00528513a135bsi15924159pgc.49.2023.05.15.12.47.09; Mon, 15 May 2023 12:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KvDlSowe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245284AbjEOTZn (ORCPT + 99 others); Mon, 15 May 2023 15:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245186AbjEOTZZ (ORCPT ); Mon, 15 May 2023 15:25:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CE517948; Mon, 15 May 2023 12:24:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8C6BD62299; 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: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765990775685978220?= X-GMAIL-MSGID: =?utf-8?q?1765990775685978220?= 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 */