From: Trent Piepho Date: Wed, 9 Apr 2008 02:19:32 +0000 (+1000) Subject: [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f13f4ca8036516ca1b99a41f95f7dea7e4dce104;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const 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 Acked-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index e5802c62f428..b95d033ae6e6 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h @@ -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; } @@ -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;