From patchwork Thu Apr 6 14:32:12 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: 80287 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1079859vqo; Thu, 6 Apr 2023 07:44:07 -0700 (PDT) X-Google-Smtp-Source: AKy350bF5dNFDd8QIwkL2SOQlZJDeUC+AXGKcMoV32Ow16IF3p3g2A+MX8W1ECE7/B00NjoNfO1b X-Received: by 2002:aa7:d59a:0:b0:504:7171:4545 with SMTP id r26-20020aa7d59a000000b0050471714545mr657839edq.9.1680792247043; Thu, 06 Apr 2023 07:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680792247; cv=none; d=google.com; s=arc-20160816; b=sGeuwIpQby6vmLQQrmwF7dZY/BatMhsICLFA6IkKyH4tkYD3RIeOLk3cGs2tCwcufG 8ntILQdUSZ/ZW9CccRlVsZw52QkS2aYKg2VZ0rFLMwJPWNJVNh0d+OyuTiaXjBVntbhL A5Ppaxk66NR6S0AKyza7YzfZo1qEC3M7aZByV7FqfWKq1Rbuv0VvKE4UxsvA3FB0yqMr OGiWmqfXkeINdSpubaSv8yaQ2osDKGxRFAXhauyAgbHZNfzjrgG21VTqwpxNuiZAiUfy hZTcMyxfqcBMUUo1jTH2Ds35BfrgCqW2wkdSDBKzCgNqm98elE8n+JHgbakew7mL/jFg MOFQ== 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=83DCRrtSJq8aIhSri57P8Nkhk9kMsmJ33d/Kt/QPqOM=; b=c8a8aJljkLWu5+UlKYFVXv413773JNmAlfnpNEr/Rc2oF0+XNPzP/1GH1wYKM+/wJ4 5WsF80Q6b6wRKALVHchaAx7zDcuSuos7wdUWxIWs6tCrMy5GKvXpQzzVLMIqMXpapyIn r1PUZOR/V2nDCPbj9ho/M3V2IGzqf+SwtshxA+9e9z00E4iDgYaZiH69aFqrRRMz29FU 9UR1HO3jUVfW3p7z/3iCwOd7+q+/zU52Re3GlF1ZMo6EJf4B/2edi4Ska98qnjOvXncP VcYXaOMYvcApo01xijV9h9RA5yPTF8KZxo/yWChiMd6LwRZphLmdotHdhMMpJxcZEm6D 62WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjiLsj18; 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 y21-20020a50e615000000b00504564d26d4si923681edm.556.2023.04.06.07.43.43; Thu, 06 Apr 2023 07:44:07 -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=SjiLsj18; 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 S238814AbjDFOiz (ORCPT + 99 others); Thu, 6 Apr 2023 10:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238352AbjDFOid (ORCPT ); Thu, 6 Apr 2023 10:38:33 -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 87284CC10; Thu, 6 Apr 2023 07:36:36 -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 CCCE06478C; Thu, 6 Apr 2023 14:31:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48A63C4339C; Thu, 6 Apr 2023 14:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680791494; bh=fS1epBKc6/LIuAlKccrK1+yZRgDIBGUB741ssPvpdOQ=; h=Date:From:To:Cc:Subject:From; b=SjiLsj18bWuofLs6hhWeLC/lLw/a3iNtZ9wlEueFZEmCpkNlYBNfrW2g/JfGJHGTi vet9hVGN3GV90yUx+3gAa/XNftBN0j39XOMRCSz2X9AIryTOjRKZkau8WazkdAVbKe 7jo/OiVuhS8JxGUofx57NN8frKBM2tj4fn33MN5OokPIYjhPFpYfjxIVlje0uFnNYq o+keawWHSe/sdTrcyzxIyVKkwcke3vee+fUSrJSER8RnbtzoGn6X9DOk/pfIaR/jlM ZoF5CIu1w4YilJ9YwXKoTj0fnpznmfu4LCYmI1CVH3mBWnGcBheecAhLYWYKRmVcUM 1CooyEc8vqBvg== Date: Thu, 6 Apr 2023 08:32:12 -0600 From: "Gustavo A. R. Silva" To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] wifi: mt76: Replace zero-length array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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?1762438411223194321?= X-GMAIL-MSGID: =?utf-8?q?1762438411223194321?= Zero-length arrays are deprecated [1] and have to be replaced by C99 flexible-array members. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help to make progress towards globally enabling -fstrict-flex-arrays=3 [2] Link: https://github.com/KSPP/linux/issues/78 [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h index a5e6ee4daf92..9bf4b4199ee3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h @@ -127,7 +127,7 @@ struct mt76_connac2_mcu_rxd { u8 rsv1[2]; u8 s2d_index; - u8 tlv[0]; + u8 tlv[]; }; struct mt76_connac2_patch_hdr {