From patchwork Fri Dec 23 14:24:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 636314 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 0745DC4332F for ; Fri, 23 Dec 2022 14:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236136AbiLWOYt (ORCPT ); Fri, 23 Dec 2022 09:24:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbiLWOYs (ORCPT ); Fri, 23 Dec 2022 09:24:48 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08B7389D1; Fri, 23 Dec 2022 06:24:47 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 9534E7E2AE; Fri, 23 Dec 2022 14:24:42 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1671805486; bh=dNPzty6+3wvC9UOMJf16amTH8c8ZgOehht68bpqpb34=; h=From:To:Cc:Subject:Date:From; b=pZBNuHiv1L3TiQm7thqehXucGb6L40REIbArmLM03emV+BgTKq3/OCg803rdwgeFf OpWJzEcQOzg+CswI1uWQVKKUEWhNSMw93Xrm7Ev3ktK05lx37pbQqXheSUPx0xJuaD 1dCTzhhuWQ4N8b10GcdIaFcdNO9dVU77KjG//R3hDBvQVBLD1cSd0Zk3Pd/PkIjop+ ne4pdS94/I6emwPbIsSQYvB6vb7OOKnw4ew2XSRfqMzekusyV+ye/U4ktj/3sRxL8C NdL/WvOr7Lj2+gMQx7vPvKBMSW9A2To7itbYbISMDw6oF+JhE3ZoKq93Kd5urLdL9K y3IZgrj2vflVQ== 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 0/2] clang warning cleanups Date: Fri, 23 Dec 2022 21:24:17 +0700 Message-Id: <20221223142419.3781410-1-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Ammar Faizi Hi, On top of Linus' tree. This series fixes clang warnings. Base commit: 8395ae05cb5a2e31d36106e8c85efa11cda849be ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi") # Patch 1: 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. # Patch 2: @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. Signed-off-by: Ammar Faizi --- Ammar Faizi (2): ACPI: Silence missing prototype warnings ACPICA: Silence 'unused-but-set variable' warning drivers/acpi/acpi_lpit.c | 1 + drivers/acpi/acpica/nsaccess.c | 4 ++-- drivers/acpi/ioapic.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) base-commit: 8395ae05cb5a2e31d36106e8c85efa11cda849be