From patchwork Sun Apr 9 00:08:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 81289 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1123217vqo; Sat, 8 Apr 2023 17:25:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Y81RljQ4hFVGOoSXd/G7kuxfWm7w3y4lbEKPdP10H47boKQ3bn3k6EjzW6v+L1FQRoJU+F X-Received: by 2002:aa7:c510:0:b0:4fb:59bb:ce71 with SMTP id o16-20020aa7c510000000b004fb59bbce71mr6850721edq.36.1680999942047; Sat, 08 Apr 2023 17:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680999942; cv=none; d=google.com; s=arc-20160816; b=T08u48M4J8BlGD3HU3IjYWX4DphWSLBLYadx9tImB4RE3blgBec6d9UedWG9boBtiZ q8TDB4rUVdhgaTanUdadvv8n7yzwVD+oDPoy1KUwG2ykZWLVh26cB4/X+8zUQ1gVH6cO 9kv6j1uNZ7qkDxqb6+CitPne2mtFB6kXkW3N4pdssw/SD03aRHd9o9PdyBok/OMxsOEF 3HnJpqvnhs71HHewfjCgqg5ap3wTZsctRNgfxYBFgTg5U/O421fLKedDu+IHcY5WUymG TEDTNxbmECO2aaV/rbeuNcJ1QdXvVEW9/1IWo9jCJZlUhRZpbqbNBo/mOTB2QDOcq62d 8A4A== 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=3Mk9TYxYTOyNqJpRPo0g8E5xlkUkmNlAGqGF5ae6wl0=; b=G1LxSh3BhTdOiICUrGWcvzZtzeYbawpR4PpQdKSVuY+XD9e9v1u+1ogbZ2dhaqPJQT lg65utfTUfByZ/la+zxalmmjaoF5h/i/pMKIj3aV9Mx1tFKxIFx+WRrHxyKDHsirrgQ/ WAFidzT3idpgmqrtVeaBLcILupVd+REpU6jiruEBy86+6tEN7J5VNZcVbuZEvyfij1PD VeUnLmXcDdfK8oJ6jFW6RL6d0RXNneYjhTuNmHgVSWR78mAPsU9iAbQ/p7yGs/2nWLPV EhTBhyngPBCztLlMeA7sD3EppAGL011VDJzRCw8TxX2SI1+5wI4GZaso3XgNxJWYrEUa gauw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOvrtaRm; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020aa7c654000000b00501de573b72si6350449edr.515.2023.04.08.17.25.15; Sat, 08 Apr 2023 17:25:42 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOvrtaRm; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbjDIAJe (ORCPT + 99 others); Sat, 8 Apr 2023 20:09:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjDIAJZ (ORCPT ); Sat, 8 Apr 2023 20:09:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4729683F0 for ; Sat, 8 Apr 2023 17:09:22 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C05A1616C0 for ; Sun, 9 Apr 2023 00:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAEB3C433EF; Sun, 9 Apr 2023 00:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680998961; bh=zplOKDm9cHPNlwiN8ZmCM/Qx7EH1y8rnpVlgkclxTVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WOvrtaRmDZ78SR/JS5E6nRvCVWDD3UuCZ/+R34yvnpc7EJXITcVPRlecCNW81Wv/X dBqOtbwLAeMj37WDSUUgHUiexwmic3xvUw0849MUfA5+hkpOimGQCyLxU+LP3UbWXM /ffLb4yMkQvGyn/x0NBOJdSeR2POlzPKiNkWlUatTx340sHkm2wWsYJjuIWRns5VX3 BJm8AEzWE6v/AtesOg8Gn+PTUY0vjfGMWsplmG29XcUO29Rf2+kk5HF6RdvsOLvnjF ufS4xF3MfFSwD2OgTvkXCinvotFbwXJ/E0VGz2N9omQ+vZqCjM/pukz5X2tJxtYZ25 82ZzBMPrTmSoA== Received: by pali.im (Postfix) id 1186E1BE4; Sun, 9 Apr 2023 02:09:18 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Christophe Leroy , Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] powerpc/fsl_uli1575: Misc cleanup Date: Sun, 9 Apr 2023 02:08:05 +0200 Message-Id: <20230409000812.18904-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230409000812.18904-1-pali@kernel.org> References: <20230409000812.18904-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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?1762656195051220108?= X-GMAIL-MSGID: =?utf-8?q?1762656195051220108?= From: Christophe Leroy Use a single line for uli_exclude_device(). Add uli_exclude_device() prototype in ppc-pci.h and guard it. Remove that prototype from mpc85xx_ds.c and mpc86xx_hpcn.c files. Make uli_pirq_to_irq[] static as it is used only in that file. Signed-off-by: Christophe Leroy Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/ppc-pci.h | 9 +++++++++ arch/powerpc/platforms/85xx/mpc85xx_ds.c | 4 +--- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 4 +--- arch/powerpc/platforms/fsl_uli1575.c | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h index f6cf0159024e..a8db969dd595 100644 --- a/arch/powerpc/include/asm/ppc-pci.h +++ b/arch/powerpc/include/asm/ppc-pci.h @@ -57,11 +57,20 @@ void eeh_sysfs_remove_device(struct pci_dev *pdev); #endif /* CONFIG_EEH */ +#ifdef CONFIG_FSL_ULI1575 +int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn); +#endif /* CONFIG_FSL_ULI1575 */ + #define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff) #else /* CONFIG_PCI */ static inline void init_pci_config_tokens(void) { } #endif /* !CONFIG_PCI */ +#if !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575) +#include +static inline int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) { return PCIBIOS_SUCCESSFUL; } +#endif /* !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575) */ + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PPC_PCI_H */ diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 70167b8f00a3..ed7b71d55b10 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -107,9 +108,6 @@ void __init mpc85xx_ds_pic_init(void) } #ifdef CONFIG_PCI -extern int uli_exclude_device(struct pci_controller *hose, - u_char bus, u_char devfn); - static struct device_node *pci_with_uli; static int mpc85xx_exclude_device(struct pci_controller *hose, diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index 7b00ebd2d7f8..3dbd396a0df5 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -39,9 +40,6 @@ #endif #ifdef CONFIG_PCI -extern int uli_exclude_device(struct pci_controller *hose, - u_char bus, u_char devfn); - static int mpc86xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) { diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 84afae7a2561..a32f9cef7845 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c @@ -13,6 +13,7 @@ #include #include +#include #define ULI_PIRQA 0x08 #define ULI_PIRQB 0x09 @@ -36,7 +37,7 @@ #define ULI_8259_IRQ14 0x0d #define ULI_8259_IRQ15 0x0f -u8 uli_pirq_to_irq[8] = { +static u8 uli_pirq_to_irq[8] = { ULI_8259_IRQ9, /* PIRQA */ ULI_8259_IRQ10, /* PIRQB */ ULI_8259_IRQ11, /* PIRQC */ @@ -341,8 +342,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, hpcd_quirk_uli5288); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, hpcd_quirk_uli5229); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, hpcd_final_uli5288); -int uli_exclude_device(struct pci_controller *hose, - u_char bus, u_char devfn) +int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) { if (bus == (hose->first_busno + 2)) { /* exclude Modem controller */