From c3139ba212ddc240656f4bcfc7c946418cd83e19 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 15 Apr 2013 10:44:18 -0600 Subject: PCI: Move cpci_hotplug_init() proto to header file cpci_hotplug_init() and cpci_hotplug_exit() are defined in cpci_hotplug_core.c but had extern declarations in pci_hotplug_core.c. This puts the declarations in a header file included both places so the compiler can help keep everything consistent. Signed-off-by: Bjorn Helgaas --- drivers/pci/hotplug/pci_hotplug_core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'drivers/pci/hotplug/pci_hotplug_core.c') diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 202f4a9..6a25f4d 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -41,6 +41,7 @@ #include #include #include "../pci.h" +#include "cpci_hotplug.h" #define MY_NAME "pci_hotplug" @@ -63,14 +64,6 @@ static bool debug; static LIST_HEAD(pci_hotplug_slot_list); static DEFINE_MUTEX(pci_hp_mutex); -#ifdef CONFIG_HOTPLUG_PCI_CPCI -extern int cpci_hotplug_init(int debug); -extern void cpci_hotplug_exit(void); -#else -static inline int cpci_hotplug_init(int debug) { return 0; } -static inline void cpci_hotplug_exit(void) { } -#endif - /* Weee, fun with macros... */ #define GET_STATUS(name,type) \ static int get_##name (struct hotplug_slot *slot, type *value) \ -- cgit v1.1 From b638d7e7b849ad402aaecfe7edb599687b5eb3a8 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 12 Apr 2013 11:18:01 -0600 Subject: PCI: Remove unused variables This fixes "set but not used" warnings found via "make W=1". Signed-off-by: Bjorn Helgaas --- drivers/pci/hotplug/pci_hotplug_core.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/pci/hotplug/pci_hotplug_core.c') diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 6a25f4d..9d4c199 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -520,10 +520,8 @@ int pci_hp_deregister(struct hotplug_slot *hotplug) int __must_check pci_hp_change_slot_info(struct hotplug_slot *hotplug, struct hotplug_slot_info *info) { - struct pci_slot *slot; if (!hotplug || !info) return -ENODEV; - slot = hotplug->pci_slot; memcpy(hotplug->info, info, sizeof(struct hotplug_slot_info)); -- cgit v1.1 From d67aed63b8bfa4a06575ed578328b02f909699ee Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 12 Apr 2013 11:18:07 -0600 Subject: PCI: Remove __must_check from definitions The __must_check (gcc "warn_unused_result") attribute only makes sense when compiling the *caller* of the function, so the attribute should appear on the declaration in the header file, not on the definition. The declarations of these functions are already annotated with __must_check. Signed-off-by: Bjorn Helgaas --- drivers/pci/hotplug/pci_hotplug_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pci/hotplug/pci_hotplug_core.c') diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 9d4c199..ec20f74 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -517,8 +517,8 @@ int pci_hp_deregister(struct hotplug_slot *hotplug) * * Returns 0 if successful, anything else for an error. */ -int __must_check pci_hp_change_slot_info(struct hotplug_slot *hotplug, - struct hotplug_slot_info *info) +int pci_hp_change_slot_info(struct hotplug_slot *hotplug, + struct hotplug_slot_info *info) { if (!hotplug || !info) return -ENODEV; -- cgit v1.1