From patchwork Fri Dec 23 14:24:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 36283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp348504wrn; Fri, 23 Dec 2022 06:29:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXs0kFcxRTgUeUIn6iaWP4pwn3b8nyskhOfselhDG4CtFMo9+DzjlyF3zWrUsZcv/muJ8Jgr X-Received: by 2002:a17:907:1b0b:b0:7c1:6344:84a with SMTP id mp11-20020a1709071b0b00b007c16344084amr12203102ejc.5.1671805758743; Fri, 23 Dec 2022 06:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671805758; cv=none; d=google.com; s=arc-20160816; b=xM07X67NaRu2RGSE070kUXJ+K/Xdw4oqgm+TvYlBjIUbnlsWTHY3D+kTiHtWyF+UFT SpN3mHixQSj0GsNJ2fj4hluj35a92pjJkWxQ1U2KQeFhnonKjfurdgbO+OSbu3ORBHY1 KQmaEvdqpBqv5fs2oa84+bBjrhVtDpDLzskWYFu6OBRZPFNg/dCORj0TiBdI7Xt9AJ5q ck0d7WS2BxmYFGo41lRSMK+g5Oa5bRtBTzRUeEFkAzi/UdB652D2QoQeAb1A2JR/N7Q5 Aj3O5ItdCg+bwO7mUhOpyfYnt0r0z83rJoivh9u/06LLL0pLRusXmfuta2TRHBDemMn1 zC4w== 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 :dkim-signature; bh=u4ULoeu2thLiubpfX6+oe1+QD0PAMTOOjJIGSH91g04=; b=K1fN4zG8YSvXsSJpzReqY8q/Ut8R002uJZ7olnpH80LymiTxu6o3i1NXd09Ks62/fT jYP7jGIFHEStNQnQ3Tb0hsbWDvudczfhUTM8JB4V0VgSwp+p3vvlixwl+ZSAMIzUxk6r E6Px/mG8tsIS9P0xdINzpO2hVVCDe9h7yKYGLiFamSpBavI19uyn/m0qfWtV3f+/ojHU Q85SB7t6a/twDxK7BIlmP5J8U1zBz594ICVkGMYAvOiccBIBb4AajeLmtCvEW5OfO/Ti x5tLJZ+dkT0uakEmZZAYJnVTLYiYSL6fTe5MUiYdzaV1kiX8ahzmf0Ol2wzd0hmNECHw HA5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=e8mFEf26; 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=gnuweeb.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a170906975600b007f1501a8c24si3054611ejy.216.2022.12.23.06.28.55; Fri, 23 Dec 2022 06:29:18 -0800 (PST) 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=@gnuweeb.org header.s=default header.b=e8mFEf26; 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=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236395AbiLWOY4 (ORCPT + 99 others); Fri, 23 Dec 2022 09:24:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236287AbiLWOYx (ORCPT ); Fri, 23 Dec 2022 09:24:53 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41117389FD; Fri, 23 Dec 2022 06:24:52 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 95EA27E2BE; Fri, 23 Dec 2022 14:24:47 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1671805491; bh=oWmzG5ovwki5HhFnqDbqYkTDAdh4eDUJl7OeVnUrGBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8mFEf26Gx1RBt4uZi7mowHRQxlD8plFc+63Y7K8VG1D0+145z3LEXfvZ9c11us/m pCzvfidENFn5qmD+4SA3QDoXtmAqA2PaEiaHR/zF3E3Om0N6hNca44Quh7tMUBpSpl 1E2gt1BzwL0zAo3YLuAQF0wFgZ+Dw/m2mnolWnwE/qv7L4LnLGszr1vQMcEAHxvMIM 0ZvpcQXzESrBi6GEiJkPoCun5DpxlTxa9PEaugFsNCUMZ4wt7YrauZlXVcO2LHBD7W Ue6OlKQlGQamHoX2QIGGdyfyAMtZSUIZTyhx9pY1wNOyHhd4Ay4HGsagdPYn941bjI bYKuPUbpa1gUw== From: Ammar Faizi To: Robert Moore , "Rafael J. Wysocki" Cc: Ammar Faizi , Len Brown , Nick Desaulniers , Tom Rix , Nathan Chancellor , Linux ACPI Mailing List , Linux Kernel Mailing List , ACPICA Mailing List , LLVM Mailing List , GNU/Weeb Mailing List Subject: [PATCH v1 1/2] ACPI: Silence missing prototype warnings Date: Fri, 23 Dec 2022 21:24:18 +0700 Message-Id: <20221223142419.3781410-2-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221223142419.3781410-1-ammar.faizi@intel.com> References: <20221223142419.3781410-1-ammar.faizi@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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?1753015395510934607?= X-GMAIL-MSGID: =?utf-8?q?1753015395510934607?= From: Ammar Faizi Compiling with clang-16: drivers/acpi/acpi_lpit.c:142:6: error: no previous prototype \ for function 'acpi_init_lpit' [-Werror,-Wmissing-prototypes] drivers/acpi/ioapic.c:212:6: error: no previous prototype \ for function 'pci_ioapic_remove' [-Werror,-Wmissing-prototypes] drivers/acpi/ioapic.c:229:5: error: no previous prototype \ for function 'acpi_ioapic_remove' [-Werror,-Wmissing-prototypes] Include "internal.h" to silence them. Cc: LLVM Mailing List Signed-off-by: Ammar Faizi --- drivers/acpi/acpi_lpit.c | 1 + drivers/acpi/ioapic.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index 50540d4d4948..3843d2576d3f 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -10,6 +10,7 @@ #include #include #include +#include "internal.h" struct lpit_residency_info { struct acpi_generic_address gaddr; diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index a690c7b18623..6677955b4a8e 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -24,6 +24,7 @@ #include #include #include +#include "internal.h" struct acpi_pci_ioapic { acpi_handle root_handle; From patchwork Fri Dec 23 14:24:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 36284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp348515wrn; Fri, 23 Dec 2022 06:29:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXthxUmSR1c9mmReQ5eJd+DPoJOBd9WVDAeksCk3GCTHHNA4XsDsMJ57S0oKfxZ2URwzvQTU X-Received: by 2002:a50:ee0d:0:b0:461:568b:fb22 with SMTP id g13-20020a50ee0d000000b00461568bfb22mr8286029eds.8.1671805760827; Fri, 23 Dec 2022 06:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671805760; cv=none; d=google.com; s=arc-20160816; b=IOrlZA57xT1t8mq02HKxQFhbZd4OuoEmW7AJC9mwtMHZG7l9tZegj9uTn6l5f1zEzA 5HKIdlRaY2UZx0qOJUDB3qhMlLV0L6SUKBSoQKEu4KeOL6JUrBtyctH8TnxlhCA/rAn8 k0i6vpWhjLjhaYwhbAFfv4eQrIxoOnSeoAQFMuPMEEXDlig+jEVWRFZBUjmeHAoL3SoL WuQUuU4O1BdM6pFzzxS+VKOL8vhDoE0iER/7ahtilPRS3Lvu1u/QGmI+QeRUHh4p0PA1 HsEgYennABz3HnmwxvwSoxPvxf6YdsLnacRulc+AWHLQ1Zw6sAHPpG1Ky3OffvTfxdFi dkLA== 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 :dkim-signature; bh=V51ZUSzq/UVgr0mZgU7mdUtVm665ZwjWQ5VtfCGFjJc=; b=rRr7wfDKGBqYZ8APBIVh5SrsEgCOxOfPywySE6s+C6u0FJlXPKK2HRArgOWsH6kx8d T5jUnnwiilQTRvw5VGjt2ndx1mpCtvVa85X2AVgafKyCwpMzlB+BChMnBT1F9zKdt3Ht /NwjR1IFvho7tDrS7cxcv423+mIjJ7pDgZDPXtG/xwxJBi+zr+g7HG5pvhZY4c2EfwrW kWASOM6W/4Mt7f9tebkHUGyBVNYH0NJoGJuZk+RglOv0Ks11PfRdDvY+LVIfIh3qeFC1 v3DUlyJaf1RWSzHBglAAn3FDxUDXw5S6vo1W+4SCgOS9p+f1bmsAPLVtYDrY2ZFTyk6K vL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=QY00C9VE; 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=gnuweeb.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a50c301000000b004672f952b7asi2831424edb.203.2022.12.23.06.28.57; Fri, 23 Dec 2022 06:29:20 -0800 (PST) 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=@gnuweeb.org header.s=default header.b=QY00C9VE; 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=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236287AbiLWOZB (ORCPT + 99 others); Fri, 23 Dec 2022 09:25:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbiLWOY6 (ORCPT ); Fri, 23 Dec 2022 09:24:58 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA063EACC; Fri, 23 Dec 2022 06:24:57 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 959477E294; Fri, 23 Dec 2022 14:24:52 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1671805496; bh=36kRhPHHUdU7fJ7TrqmVEqnC9MhObrpC3zL5rKf5PmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QY00C9VEs5iLtoDJTH60avD25mN1yk8Wh/CY+oLn0a+zSoFrI4UfpRDls0UyuUywx jLNt5XArojl5fzAp5z40SEIycAz5sbVJpuaPJUT1A+2psgHQ5qWZ8K4j0mBa5qgzQs 8T5fEZgUGLQjbHKkoEPkKal8ecW4B0yEi2iuY7yBvfA7287RD49l0I/jLZtXyNQQ4g ch2de72lD9hJQBHr3vpd4e3OYeWcJtWcUi+5Suqzg/4KKL5Wp2jBI01So9WPNJVEDm Xbc67OaO6ArnP0WKHn8T4q2B/pDY1cPaONyYDyBqv9zrbd9jTVwKtGP8U6UeBaTMsj wzFNgLwGcyhTw== From: Ammar Faizi To: Robert Moore , "Rafael J. Wysocki" Cc: Ammar Faizi , Len Brown , Nick Desaulniers , Tom Rix , Nathan Chancellor , Linux ACPI Mailing List , Linux Kernel Mailing List , ACPICA Mailing List , LLVM Mailing List , GNU/Weeb Mailing List Subject: [PATCH v1 2/2] ACPICA: Silence 'unused-but-set variable' warning Date: Fri, 23 Dec 2022 21:24:19 +0700 Message-Id: <20221223142419.3781410-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221223142419.3781410-1-ammar.faizi@intel.com> References: <20221223142419.3781410-1-ammar.faizi@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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?1753015397559950179?= X-GMAIL-MSGID: =?utf-8?q?1753015397559950179?= From: Ammar Faizi @num_carats is used for debugging, passed to the 'ACPI_DEBUG_PRINT()' macro. But this macro will expand to nothing when debug is disabled, resulting in the following (clang-16): drivers/acpi/acpica/nsaccess.c:295:6: error: variable 'num_carats' set \ but not used [-Werror,-Wunused-but-set-variable] u32 num_carats; ^ 1 error generated. Move the variable declaration inside the else block to reduce the scope, then add '(void)num_carats' to silence the warning when debug is disabled. Cc: LLVM Mailing List Signed-off-by: Ammar Faizi --- drivers/acpi/acpica/nsaccess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index a0c1a665dfc1..d73d052c5b3b 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c @@ -292,7 +292,6 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, struct acpi_namespace_node *current_node = NULL; struct acpi_namespace_node *this_node = NULL; u32 num_segments; - u32 num_carats; acpi_name simple_name; acpi_object_type type_to_check_for; acpi_object_type this_search_type; @@ -394,6 +393,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, "Path is absolute from root [%p]\n", this_node)); } else { + u32 num_carats = 0; /* Pathname is relative to current scope, start there */ ACPI_DEBUG_PRINT((ACPI_DB_NAMES, @@ -406,7 +406,6 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, * the parent node for each prefix instance. */ this_node = prefix_node; - num_carats = 0; while (*path == (u8) AML_PARENT_PREFIX) { /* Name is fully qualified, no search rules apply */ @@ -449,6 +448,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, "Search scope is [%4.4s], path has %u carat(s)\n", acpi_ut_get_node_name (this_node), num_carats)); + (void)num_carats; } }