Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4532343rwb; Mon, 8 Aug 2022 02:42:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR4w/DxoViD+Q0yk/v78YkU8W8t1iEayuJGmk6CTFpY0VtjmbKtaR0THQFnkKskH1uB2O84F X-Received: by 2002:aa7:8289:0:b0:52c:e97c:dbe4 with SMTP id s9-20020aa78289000000b0052ce97cdbe4mr17629840pfm.49.1659951764991; Mon, 08 Aug 2022 02:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659951764; cv=none; d=google.com; s=arc-20160816; b=mC1cAR562ePVunO8NDSAOd2zAVACoQ7XMFqKAZC9awRLVinqRU5EE2T+zjiy76GS/w CPN0uO34PZfmArDMOQLwLPjiExMJ4aXqOCTRr2963zGjPzP5FcDFaTsUMuP+wHClLsnz i8cxe/TeyRn1AEa6hFaqNMqC9+QKoPFEle8S/JYy44PmIdOkrfM9qUr5Pg+5B1hpf3IZ WLy5ievA9RMAtI+kGSKAmoih8w5jlCEw+dv6md6/xy31OIe5/IQb0gW4hsBLgOd7XDUW p7lIAB6st80/LsdMf0eaj38Qhs87lzhfkUUJhUwHlkruc+WMuhQzgLFPuaciBsYGWJ8j aRKg== 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 :message-id:date:subject:cc:to:from; bh=JXFuzJ/sdmsrvIPq3emtssid/UQKcsIQnkLxyEvDSuk=; b=ovXdVJV2umd018Z1yUxk0T2wdFs5iMqX7ZQmTRxHLs5zlALm+R/DPnx3ty2m6nh7Df rHiIQeNVA9XVlMRz138sBa2GUiGxgsuoFDKGT3GU7DETgn0LW2Vm2nEz2yw8DeZ0OHKr Kg88V8lSXu8EkpdAYJSqjQLLtEha860ngxz9wlQldTqFEr1JQ3bHAJ97klbJc+0IdpTp +lEmIBC00XppTFlsZECQ2ni9Q4rkqUg8LtBl/njYQu5a0pAw5k2j3wYDnlOwNA3qAU2x zqi7qk48WMRhoGECxCb3E8DLFUHNxdlSHGvbP1QIufAwfKpgvKmwFN509eqvmwlcooSi +P2g== 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 m19-20020a170902bb9300b001624d7f36acsi10143879pls.592.2022.08.08.02.42.31; Mon, 08 Aug 2022 02:42:44 -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 S242691AbiHHJcq (ORCPT + 99 others); Mon, 8 Aug 2022 05:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242657AbiHHJcZ (ORCPT ); Mon, 8 Aug 2022 05:32:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A25AD14D20 for ; Mon, 8 Aug 2022 02:32:11 -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 ams.source.kernel.org (Postfix) with ESMTPS id B2E32B80E23 for ; Mon, 8 Aug 2022 09:32:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77DC9C433D7; Mon, 8 Aug 2022 09:32:06 +0000 (UTC) From: Huacai Chen To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, Xuefeng Li , Huacai Chen , Jiaxun Yang , Huacai Chen , kernel test robot Subject: [PATCH V2] irqchip/loongson-pch-pic: Move find_pch_pic() into CONFIG_ACPI Date: Mon, 8 Aug 2022 17:32:05 +0800 Message-Id: <20220808093205.3658485-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 MIPS doesn't declare find_pch_pic(), which makes a build warning: >> drivers/irqchip/irq-loongson-pch-pic.c:51:5: warning: no previous prototype for function 'find_pch_pic' [-Wmissing-prototypes] int find_pch_pic(u32 gsi) ^ drivers/irqchip/irq-loongson-pch-pic.c:51:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int find_pch_pic(u32 gsi) ^ static 1 warning generated. Move find_pch_pic() into CONFIG_ACPI which only used by LoongArch to fix the warning. BTW, remove the duplicated declaration of find_pch_pic() in irq.h. Reported-by: kernel test robot Signed-off-by: Huacai Chen --- V2: Remove the duplicated declaration of find_pch_pic() in irq.h. arch/loongarch/include/asm/irq.h | 1 - drivers/irqchip/irq-loongson-pch-pic.c | 38 +++++++++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/arch/loongarch/include/asm/irq.h b/arch/loongarch/include/asm/irq.h index 149b2123e7f4..093aee99167d 100644 --- a/arch/loongarch/include/asm/irq.h +++ b/arch/loongarch/include/asm/irq.h @@ -81,7 +81,6 @@ extern struct acpi_vector_group msi_group[MAX_IO_PICS]; #define GSI_MIN_PCH_IRQ LOONGSON_PCH_IRQ_BASE #define GSI_MAX_PCH_IRQ (LOONGSON_PCH_IRQ_BASE + 256 - 1) -extern int find_pch_pic(u32 gsi); extern int eiointc_get_node(int id); struct acpi_madt_lio_pic; diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index b6f1392964b1..b987b6517d59 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -48,25 +48,6 @@ static struct pch_pic *pch_pic_priv[MAX_IO_PICS]; struct fwnode_handle *pch_pic_handle[MAX_IO_PICS]; -int find_pch_pic(u32 gsi) -{ - int i; - - /* Find the PCH_PIC that manages this GSI. */ - for (i = 0; i < MAX_IO_PICS; i++) { - struct pch_pic *priv = pch_pic_priv[i]; - - if (!priv) - return -1; - - if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count)) - return i; - } - - pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi); - return -1; -} - static void pch_pic_bitset(struct pch_pic *priv, int offset, int bit) { u32 reg; @@ -325,6 +306,25 @@ IRQCHIP_DECLARE(pch_pic, "loongson,pch-pic-1.0", pch_pic_of_init); #endif #ifdef CONFIG_ACPI +int find_pch_pic(u32 gsi) +{ + int i; + + /* Find the PCH_PIC that manages this GSI. */ + for (i = 0; i < MAX_IO_PICS; i++) { + struct pch_pic *priv = pch_pic_priv[i]; + + if (!priv) + return -1; + + if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count)) + return i; + } + + pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi); + return -1; +} + static int __init pch_lpc_parse_madt(union acpi_subtable_headers *header, const unsigned long end) -- 2.31.1