From patchwork Mon Jul 10 17:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 118001 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp5191730vqx; Mon, 10 Jul 2023 10:52:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFAdA7mLgh1crzTV4L5CN0hh/F3tAMxoB5czg6nEtsyKNMzFadm+Bv2sq2sqW4z3HpAEvtC X-Received: by 2002:a17:906:3504:b0:982:bb95:5014 with SMTP id r4-20020a170906350400b00982bb955014mr10757427eja.64.1689011560548; Mon, 10 Jul 2023 10:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689011560; cv=none; d=google.com; s=arc-20160816; b=Q41UC6Ogv/P2HeT8KTZkWKoAMcR8XtjGxUxi7iPKwwNLKzMi/8YsQGtf4HXXG44vpU saZmXZLRkkBf6QEFUwVFcr1QV4CkSps47/3uLDPqLUdDJ1M/HehbHOe6SC+3mi5N2CFk SAMDjBzb43lQJB/LRWNlcsGkFTRfqODNBaZ7v3uGoQ9uF71M/Ma4OWx9scutvI+kIBlR EhJFS8E20Hy8iDpw65lG2ihlbud7nSi/ljym57uYVWFEXnzgkX6/W4daGpOrhW5JHfJX PPagXkCEnuq1oOUByDqJ+UtN901qrR3UTRwaIYXVQxpD3zaNy4iCMP6gKXbeimOqdVPQ uSQg== 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=7vihKffPUPaZb/Log3XBl4vHaqGAjJEXnKt3migA+og=; fh=odud58AEZ8dpT9wVpEi49z2KFyKsW9gCOcsWyWRzkG0=; b=ZmFhH5nN7lU6LV3sFoROx6emj5NURyS2+pGe1E2sdYjAJnumEphRHJhrp8RKU9QueO j9JTqOxMzn8o10/i7CjOvuC2rXEZcH8/v8Q+uzmjQf/g48CYbTFquJscqwanvZEqX8YX IkXjA6E05RK8MDiSDms3KOwBmSKyFfWjzq0fE6YPPmwANMOqpLyG1EgzawpOkyrnR8Nt txe/aCGywMeaVP8OQUF2HYBpihx+pW2o9j2waRiVIk5H1yLMBvvqKjjpOXeZbRQ8vMca 9h8yq40tunyNEkpBEUbgCBlA10lq/6E9vXd3FyhNP0RU6+dKaBRYizf5mDWLf1QW/t9n IyjA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a17090638cf00b0099331b3e790si62875ejd.654.2023.07.10.10.52.16; Mon, 10 Jul 2023 10:52:40 -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 S232814AbjGJRYW (ORCPT + 99 others); Mon, 10 Jul 2023 13:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbjGJRXp (ORCPT ); Mon, 10 Jul 2023 13:23:45 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483FEC4; Mon, 10 Jul 2023 10:23:43 -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.2.0) id fbf52e4b15011c9f; Mon, 10 Jul 2023 19:23:41 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (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 36D34660DCF; Mon, 10 Jul 2023 19:23:41 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Bob Moore , Saket Dumbre Subject: [PATCH 01/14] ACPICA: Fix GCC 12 dangling-pointer warning Date: Mon, 10 Jul 2023 19:11:30 +0200 Message-ID: <4851363.31r3eYUQgx@kreacher> In-Reply-To: <5698695.DvuYhMxLoT@kreacher> References: <5698695.DvuYhMxLoT@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrvdekgddutdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepledtieekkeekveeikeetgffgteeuteefjeevjeegudelvdduheeiuedvieehieevnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeegpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosggvrhhtrdhmohhorhgvsehinhhtvghlrdgtohhmpdhrtghpthhtohepshgrkhgvthdrughumhgsrhgv sehinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771056986025360966 X-GMAIL-MSGID: 1771056986025360966 From: Philip Prindeville ACPICA commit aea0a5cfce262ce2ab16fd96d87c12cf5e756380 We're storing a persistent pointer to an ephemeral local variable which technically is a dangling pointer and the compiler is correct. However, since we never indirect the pointer, this is a safe operation and we can suppress the warning. Also, some C run-times (like MUSL) aren't including indirectly so we must include it explicitly or we won't have the type definition for uintptr_t. Link: https://github.com/acpica/acpica/commit/aea0a5cf Signed-off-by: Philip Prindeville Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/utdebug.c | 5 +++++ include/acpi/platform/aclinux.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index 1bbba8585fa6..c5f6c85a3a09 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c @@ -37,7 +37,12 @@ void acpi_ut_init_stack_ptr_trace(void) { acpi_size current_sp; +#pragma GCC diagnostic push +#if defined(__GNUC__) && __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Wdangling-pointer=" +#endif acpi_gbl_entry_stack_pointer = ¤t_sp; +#pragma GCC diagnostic pop } /******************************************************************************* diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 1ca450e35c0d..565341c826e3 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -182,6 +182,7 @@ #ifdef ACPI_USE_STANDARD_HEADERS #include #include +#include #define ACPI_OFFSET(d, f) offsetof(d, f) #endif