Skip to content

Commit

Permalink
[POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const
Browse files Browse the repository at this point in the history
A) It's not modified and so it can be made const.  const is good.
B) If one has a function that was given a const pci_bus pointer and you
want to get a pointer to its pci_controller, you'll get a warning from gcc
when you use pci_bus_to_host().  This is the right way to stop that
warning.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Trent Piepho authored and Paul Mackerras committed Apr 18, 2008
1 parent 49a9997 commit f13f4ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-powerpc/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct pci_controller {

#ifndef CONFIG_PPC64

static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
{
return bus->sysdata;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);

extern int pcibios_remove_root_bus(struct pci_controller *phb);

static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
{
struct device_node *busdn = bus->sysdata;

Expand Down

0 comments on commit f13f4ca

Please sign in to comment.