[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181108235134.GH41183@google.com>
Date: Thu, 8 Nov 2018 17:51:35 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Zubin Mithra <zsm@...omium.org>
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
hch@...radead.org, groeck@...omium.org, keescook@...omium.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [RFC] x86/pci: Mark pci_root_ops as const
Hi Zubin,
On Thu, Nov 08, 2018 at 09:11:15AM -0800, Zubin Mithra wrote:
> pci_root_ops is only written to from within intel_mid_pci_init. This
> is linked in only when CONFIG_X86_INTEL_MID is set. If not for this,
> pci_root_ops could be marked as const.
>
> Fix this by replacing pci_root_ops usage with pci_root_ops_ptr. If
> CONFIG_X86_INTEL_MID is set, pci_root_ops_ptr will be set to
> intel_mid_pci_ops inside intel_mid_pci_init.
>
> Introduce pci_acpi_set_ops for intel_mid_pci_init to set
> acpi_pci_root_ops.pci_ops.
>
> This also means that intel_mid_pci_ops cannot be freed after init, hence
> remove __initconst.
>
> Signed-off-by: Zubin Mithra <zsm@...omium.org>
> ---
> arch/x86/include/asm/pci_x86.h | 4 +++-
> arch/x86/pci/acpi.c | 5 +++++
> arch/x86/pci/common.c | 5 +++--
> arch/x86/pci/intel_mid_pci.c | 5 +++--
> drivers/pci/access.c | 4 ++--
> drivers/pci/probe.c | 4 ++--
> include/linux/pci-acpi.h | 2 +-
> include/linux/pci.h | 11 ++++++-----
> 8 files changed, 25 insertions(+), 15 deletions(-)
Can you:
- Split this into an x86 patch and a PCI core patch (if possible)?
- Make the same fixes for other arches?
Bjorn
Powered by blists - more mailing lists