From patchwork Mon Sep 26 21:50:03 2022 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: 12989453 X-Patchwork-Delegate: kuba@kernel.org 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 75764C07E9D for ; Mon, 26 Sep 2022 21:50:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbiIZVuO (ORCPT ); Mon, 26 Sep 2022 17:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiIZVuL (ORCPT ); Mon, 26 Sep 2022 17:50:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54ADEA4856; Mon, 26 Sep 2022 14:50:10 -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 BF6B061470; Mon, 26 Sep 2022 21:50:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CD44C433D7; Mon, 26 Sep 2022 21:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664229009; bh=l0Dc2OIgK6lDM9BiZQEoOrqzj1XCqlR7nr3AsvHsNAI=; h=Date:From:To:Cc:Subject:From; b=l5jarwkxEMBNTo7wGZhpGo/oDMGwId6FaZfNamx8do5p5G+EuOLUw80blLhpv/S7S +hBOIRjwVEoOvePV14Do9qikJyGZ6ARj/bGv2YeMCRdt8pwLXiFmCX6W63XKKIm5vs pDJXisCZM2a8yS814sMGAX9UuEpwC03U/B7W2VTOXBCWGCwdEBjiWb6UYVZfNG48pV 0wqvAq185oVotTBuCn1T3GBEloYhwgiRUDCnQo7w084FgCiT1bfb1DVj6sU07AxYgm JrxazJJrYJhPT/FuXA+ScF7vbtOUxklEBgau8OFzELTpOVTiL4D+DhAgUpvvksTLwp FF11Pp95h2GIA== Date: Mon, 26 Sep 2022 16:50:03 -0500 From: "Gustavo A. R. Silva" To: Subash Abhinov Kasiviswanathan , Sean Tranchetti , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] net: ethernet: rmnet: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/221 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h index e5a0b38f7dbe..2b033060fc20 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h @@ -19,7 +19,7 @@ struct rmnet_map_control_command { __be16 flow_control_seq_num; __be32 qos_id; } flow_control; - u8 data[0]; + DECLARE_FLEX_ARRAY(u8, data); }; } __aligned(1);