Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp412847pxb; Tue, 12 Apr 2022 04:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXd1yA81K2T8qmcClpbd/O2A3MDTzfTX+dLp/f6EBtQ9p01B5RvIMeF5pMKmJWGIOzcOQE X-Received: by 2002:a17:90a:410a:b0:1cb:a279:6679 with SMTP id u10-20020a17090a410a00b001cba2796679mr4584886pjf.211.1649764775433; Tue, 12 Apr 2022 04:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649764775; cv=none; d=google.com; s=arc-20160816; b=ogmxaF26fFGG+0x6Hkd59dvgU6yqCOHb3xeMnQuviVJQZZP5VLjWLZID7b7bZQfJ40 laDj6/kRJ/PM0eMeXD/V8bwrBrepdcxpzz/U9rud4vcQL+j6fJTdroNMgZd4nSKFZhEe ypl3OXa40QM2GqEfviZSregwPZlbWtXUpwECBceUB0vxOKrRxkeYfbryZH3spK8DU/no 0ZSlsoWHBwxAWlDCYw2zkWELldtwsdL4GWzj+5ZNK4K48IE3EWgQySfpsrRcyAyWMvHN rgYtX9obQk+xmHsK4xW7QhHiVVW5k6kbYdvNqrbS28Q8fgDC89kLu2+Umpyswg0gcx+i yI3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oX4BbHSedFje0Ld+E6Hye7SkVbeAboY8KPLedTacW4E=; b=U1j1gPbziLF6xgeR9olkOeiqC/aRnQ61GH4ef/EB0tmU8oifL0alQ975VQjgqLeVY9 q01I+40HK4YbijHU6HwFnMVZAGa8LfEW0aqkrLm3caRQFp8v1ni+5VCD4erLDeunqo7H 7jK0YIfpcijKBI3rZrYq7d3gea+Rhgp4cDeL6I/rJjcIDc6zu3Bgl1AIyepHCQxyZBEL aBX36+xz5+c4CM39axX0iMTqEPBfOnbtguB7pH1m6/VBNAsBznd9Z4C4WQh/76hGC8kG dtB11s1D5jaH4vmjHSligewFu9B5oIgudRjkxnO3DwY0yiMFjDveTfLsJipYyq+Ow/cf KX6g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f63-20020a636a42000000b003816043f005si2365408pgc.506.2022.04.12.04.59.22; Tue, 12 Apr 2022 04:59:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347428AbiDKTIT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Apr 2022 15:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349356AbiDKTHK (ORCPT ); Mon, 11 Apr 2022 15:07:10 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9BFD3337C; Mon, 11 Apr 2022 12:04:30 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id b5eec240c5abce10; Mon, 11 Apr 2022 21:04:28 +0200 Received: from kreacher.localnet (unknown [213.134.175.113]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 4F86066BDFE; Mon, 11 Apr 2022 21:04:28 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Bob Moore Subject: [PATCH 11/20] ACPICA: Headers: Replace zero-length array with flexible-array member Date: Mon, 11 Apr 2022 20:56:15 +0200 Message-ID: <5732090.MhkbZ0Pkbq@kreacher> In-Reply-To: <5578328.DvuYhMxLoT@kreacher> References: <5578328.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.175.113 X-CLIENT-HOSTNAME: 213.134.175.113 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudekiedgudefhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepudeftefghedvvdetudfhkeegffeihfdugfevleevvddvkeevvddukeekvdelhefgnecuffhomhgrihhnpeifihhkihhpvgguihgrrdhorhhgpdhkvghrnhgvlhdrohhrghdpghhithhhuhgsrdgtohhmnecukfhppedvudefrddufeegrddujeehrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudejhedruddufedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepfedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehrohgsvghrthdrmhhoohhrvges ihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 From: Gustavo A. R. Silva ACPICA commit 98835f452c698b015d4da999944405ecb90da670 There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/acpica/acpica/commit/98835f45 Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/actbl2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-pm/include/acpi/actbl2.h =================================================================== --- linux-pm.orig/include/acpi/actbl2.h +++ linux-pm/include/acpi/actbl2.h @@ -2310,7 +2310,7 @@ struct acpi_table_rgrt { u16 version; u8 image_type; u8 reserved; - u8 image[0]; + u8 image[]; }; /* image_type values */