aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorRyan Desfosses <ryan@desfo.org>2014-04-18 20:13:49 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-06-10 22:20:19 -0400
commit3c78bc61f5ef3bc87e7f94f67ec737d2273f120b (patch)
tree490efb8676389718e78a4d6775ad668538ecaf4f /drivers/pci/hotplug
parentb7fe943421396b61b9f7a97c2554ed999e0f3658 (diff)
PCI: Whitespace cleanup
Fix various whitespace errors. No functional change. [bhelgaas: fix other similar problems] Signed-off-by: Ryan Desfosses <ryan@desfo.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/cpci_hotplug.h18
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c18
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c18
-rw-r--r--drivers/pci/hotplug/cpcihp_generic.c8
-rw-r--r--drivers/pci/hotplug/cpcihp_zt5550.c2
-rw-r--r--drivers/pci/hotplug/cpqphp.h4
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c6
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c26
-rw-r--r--drivers/pci/hotplug/cpqphp_nvram.c32
-rw-r--r--drivers/pci/hotplug/cpqphp_pci.c26
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c2
-rw-r--r--drivers/pci/hotplug/ibmphp_core.c32
-rw-r--r--drivers/pci/hotplug/ibmphp_ebda.c10
-rw-r--r--drivers/pci/hotplug/ibmphp_hpc.c6
-rw-r--r--drivers/pci/hotplug/ibmphp_pci.c4
-rw-r--r--drivers/pci/hotplug/ibmphp_res.c12
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c96
-rw-r--r--drivers/pci/hotplug/pciehp_acpi.c4
-rw-r--r--drivers/pci/hotplug/pciehp_core.c4
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c2
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c46
-rw-r--r--drivers/pci/hotplug/pcihp_skeleton.c38
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c6
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c2
-rw-r--r--drivers/pci/hotplug/shpchp.h4
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c2
-rw-r--r--drivers/pci/hotplug/shpchp_hpc.c12
-rw-r--r--drivers/pci/hotplug/shpchp_sysfs.c2
28 files changed, 218 insertions, 224 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index 1356211431d0..6a0ddf757349 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -56,9 +56,9 @@ struct cpci_hp_controller_ops {
56 int (*enable_irq) (void); 56 int (*enable_irq) (void);
57 int (*disable_irq) (void); 57 int (*disable_irq) (void);
58 int (*check_irq) (void *dev_id); 58 int (*check_irq) (void *dev_id);
59 int (*hardware_test) (struct slot* slot, u32 value); 59 int (*hardware_test) (struct slot *slot, u32 value);
60 u8 (*get_power) (struct slot* slot); 60 u8 (*get_power) (struct slot *slot);
61 int (*set_power) (struct slot* slot, int value); 61 int (*set_power) (struct slot *slot, int value);
62}; 62};
63 63
64struct cpci_hp_controller { 64struct cpci_hp_controller {
@@ -89,13 +89,13 @@ int cpci_hp_stop(void);
89u8 cpci_get_attention_status(struct slot *slot); 89u8 cpci_get_attention_status(struct slot *slot);
90u8 cpci_get_latch_status(struct slot *slot); 90u8 cpci_get_latch_status(struct slot *slot);
91u8 cpci_get_adapter_status(struct slot *slot); 91u8 cpci_get_adapter_status(struct slot *slot);
92u16 cpci_get_hs_csr(struct slot * slot); 92u16 cpci_get_hs_csr(struct slot *slot);
93int cpci_set_attention_status(struct slot *slot, int status); 93int cpci_set_attention_status(struct slot *slot, int status);
94int cpci_check_and_clear_ins(struct slot * slot); 94int cpci_check_and_clear_ins(struct slot *slot);
95int cpci_check_ext(struct slot * slot); 95int cpci_check_ext(struct slot *slot);
96int cpci_clear_ext(struct slot * slot); 96int cpci_clear_ext(struct slot *slot);
97int cpci_led_on(struct slot * slot); 97int cpci_led_on(struct slot *slot);
98int cpci_led_off(struct slot * slot); 98int cpci_led_off(struct slot *slot);
99int cpci_configure_slot(struct slot *slot); 99int cpci_configure_slot(struct slot *slot);
100int cpci_unconfigure_slot(struct slot *slot); 100int cpci_unconfigure_slot(struct slot *slot);
101 101
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 1bd77fdd5b13..e09cf7827d68 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -65,10 +65,10 @@ static int thread_finished;
65static int enable_slot(struct hotplug_slot *slot); 65static int enable_slot(struct hotplug_slot *slot);
66static int disable_slot(struct hotplug_slot *slot); 66static int disable_slot(struct hotplug_slot *slot);
67static int set_attention_status(struct hotplug_slot *slot, u8 value); 67static int set_attention_status(struct hotplug_slot *slot, u8 value);
68static int get_power_status(struct hotplug_slot *slot, u8 * value); 68static int get_power_status(struct hotplug_slot *slot, u8 *value);
69static int get_attention_status(struct hotplug_slot *slot, u8 * value); 69static int get_attention_status(struct hotplug_slot *slot, u8 *value);
70static int get_adapter_status(struct hotplug_slot *slot, u8 * value); 70static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
71static int get_latch_status(struct hotplug_slot *slot, u8 * value); 71static int get_latch_status(struct hotplug_slot *slot, u8 *value);
72 72
73static struct hotplug_slot_ops cpci_hotplug_slot_ops = { 73static struct hotplug_slot_ops cpci_hotplug_slot_ops = {
74 .enable_slot = enable_slot, 74 .enable_slot = enable_slot,
@@ -168,7 +168,7 @@ cpci_get_power_status(struct slot *slot)
168} 168}
169 169
170static int 170static int
171get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) 171get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
172{ 172{
173 struct slot *slot = hotplug_slot->private; 173 struct slot *slot = hotplug_slot->private;
174 174
@@ -177,7 +177,7 @@ get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
177} 177}
178 178
179static int 179static int
180get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) 180get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
181{ 181{
182 struct slot *slot = hotplug_slot->private; 182 struct slot *slot = hotplug_slot->private;
183 183
@@ -192,14 +192,14 @@ set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
192} 192}
193 193
194static int 194static int
195get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) 195get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
196{ 196{
197 *value = hotplug_slot->info->adapter_status; 197 *value = hotplug_slot->info->adapter_status;
198 return 0; 198 return 0;
199} 199}
200 200
201static int 201static int
202get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) 202get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
203{ 203{
204 *value = hotplug_slot->info->latch_status; 204 *value = hotplug_slot->info->latch_status;
205 return 0; 205 return 0;
@@ -362,7 +362,7 @@ static int
362init_slots(int clear_ins) 362init_slots(int clear_ins)
363{ 363{
364 struct slot *slot; 364 struct slot *slot;
365 struct pci_dev* dev; 365 struct pci_dev *dev;
366 366
367 dbg("%s - enter", __func__); 367 dbg("%s - enter", __func__);
368 down_read(&list_rwsem); 368 down_read(&list_rwsem);
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index f6ef64c2ccb5..7d48ecae6695 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -46,7 +46,7 @@ extern int cpci_debug;
46#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) 46#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
47 47
48 48
49u8 cpci_get_attention_status(struct slot* slot) 49u8 cpci_get_attention_status(struct slot *slot)
50{ 50{
51 int hs_cap; 51 int hs_cap;
52 u16 hs_csr; 52 u16 hs_csr;
@@ -66,7 +66,7 @@ u8 cpci_get_attention_status(struct slot* slot)
66 return hs_csr & 0x0008 ? 1 : 0; 66 return hs_csr & 0x0008 ? 1 : 0;
67} 67}
68 68
69int cpci_set_attention_status(struct slot* slot, int status) 69int cpci_set_attention_status(struct slot *slot, int status)
70{ 70{
71 int hs_cap; 71 int hs_cap;
72 u16 hs_csr; 72 u16 hs_csr;
@@ -93,7 +93,7 @@ int cpci_set_attention_status(struct slot* slot, int status)
93 return 1; 93 return 1;
94} 94}
95 95
96u16 cpci_get_hs_csr(struct slot* slot) 96u16 cpci_get_hs_csr(struct slot *slot)
97{ 97{
98 int hs_cap; 98 int hs_cap;
99 u16 hs_csr; 99 u16 hs_csr;
@@ -111,7 +111,7 @@ u16 cpci_get_hs_csr(struct slot* slot)
111 return hs_csr; 111 return hs_csr;
112} 112}
113 113
114int cpci_check_and_clear_ins(struct slot* slot) 114int cpci_check_and_clear_ins(struct slot *slot)
115{ 115{
116 int hs_cap; 116 int hs_cap;
117 u16 hs_csr; 117 u16 hs_csr;
@@ -140,7 +140,7 @@ int cpci_check_and_clear_ins(struct slot* slot)
140 return ins; 140 return ins;
141} 141}
142 142
143int cpci_check_ext(struct slot* slot) 143int cpci_check_ext(struct slot *slot)
144{ 144{
145 int hs_cap; 145 int hs_cap;
146 u16 hs_csr; 146 u16 hs_csr;
@@ -161,7 +161,7 @@ int cpci_check_ext(struct slot* slot)
161 return ext; 161 return ext;
162} 162}
163 163
164int cpci_clear_ext(struct slot* slot) 164int cpci_clear_ext(struct slot *slot)
165{ 165{
166 int hs_cap; 166 int hs_cap;
167 u16 hs_csr; 167 u16 hs_csr;
@@ -187,7 +187,7 @@ int cpci_clear_ext(struct slot* slot)
187 return 0; 187 return 0;
188} 188}
189 189
190int cpci_led_on(struct slot* slot) 190int cpci_led_on(struct slot *slot)
191{ 191{
192 int hs_cap; 192 int hs_cap;
193 u16 hs_csr; 193 u16 hs_csr;
@@ -216,7 +216,7 @@ int cpci_led_on(struct slot* slot)
216 return 0; 216 return 0;
217} 217}
218 218
219int cpci_led_off(struct slot* slot) 219int cpci_led_off(struct slot *slot)
220{ 220{
221 int hs_cap; 221 int hs_cap;
222 u16 hs_csr; 222 u16 hs_csr;
@@ -303,7 +303,7 @@ int cpci_configure_slot(struct slot *slot)
303 return ret; 303 return ret;
304} 304}
305 305
306int cpci_unconfigure_slot(struct slot* slot) 306int cpci_unconfigure_slot(struct slot *slot)
307{ 307{
308 struct pci_dev *dev, *temp; 308 struct pci_dev *dev, *temp;
309 309
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index 7536eef620b0..04fcd7811400 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -78,8 +78,8 @@ static struct cpci_hp_controller generic_hpc;
78 78
79static int __init validate_parameters(void) 79static int __init validate_parameters(void)
80{ 80{
81 char* str; 81 char *str;
82 char* p; 82 char *p;
83 unsigned long tmp; 83 unsigned long tmp;
84 84
85 if(!bridge) { 85 if(!bridge) {
@@ -142,8 +142,8 @@ static int query_enum(void)
142static int __init cpcihp_generic_init(void) 142static int __init cpcihp_generic_init(void)
143{ 143{
144 int status; 144 int status;
145 struct resource* r; 145 struct resource *r;
146 struct pci_dev* dev; 146 struct pci_dev *dev;
147 147
148 info(DRIVER_DESC " version: " DRIVER_VERSION); 148 info(DRIVER_DESC " version: " DRIVER_VERSION);
149 status = validate_parameters(); 149 status = validate_parameters();
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c
index e8c4a7ccf578..6757b3ef7e10 100644
--- a/drivers/pci/hotplug/cpcihp_zt5550.c
+++ b/drivers/pci/hotplug/cpcihp_zt5550.c
@@ -295,7 +295,7 @@ static struct pci_driver zt5550_hc_driver = {
295 295
296static int __init zt5550_init(void) 296static int __init zt5550_init(void)
297{ 297{
298 struct resource* r; 298 struct resource *r;
299 int rc; 299 int rc;
300 300
301 info(DRIVER_DESC " version: " DRIVER_VERSION); 301 info(DRIVER_DESC " version: " DRIVER_VERSION);
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
index 516b87738b6e..0450f405807d 100644
--- a/drivers/pci/hotplug/cpqphp.h
+++ b/drivers/pci/hotplug/cpqphp.h
@@ -255,7 +255,7 @@ struct pci_func {
255 struct pci_resource *io_head; 255 struct pci_resource *io_head;
256 struct pci_resource *bus_head; 256 struct pci_resource *bus_head;
257 struct timer_list *p_task_event; 257 struct timer_list *p_task_event;
258 struct pci_dev* pci_dev; 258 struct pci_dev *pci_dev;
259}; 259};
260 260
261struct slot { 261struct slot {
@@ -278,7 +278,7 @@ struct slot {
278}; 278};
279 279
280struct pci_resource { 280struct pci_resource {
281 struct pci_resource * next; 281 struct pci_resource *next;
282 u32 base; 282 u32 base;
283 u32 length; 283 u32 length;
284}; 284};
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 037e2612c5bd..868e62fc869b 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -94,7 +94,7 @@ static inline int is_slot66mhz(struct slot *slot)
94 * 94 *
95 * Returns pointer to the head of the SMBIOS tables (or %NULL). 95 * Returns pointer to the head of the SMBIOS tables (or %NULL).
96 */ 96 */
97static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end) 97static void __iomem *detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end)
98{ 98{
99 void __iomem *fp; 99 void __iomem *fp;
100 void __iomem *endp; 100 void __iomem *endp;
@@ -131,7 +131,7 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e
131 * 131 *
132 * For unexpected switch opens 132 * For unexpected switch opens
133 */ 133 */
134static int init_SERR(struct controller * ctrl) 134static int init_SERR(struct controller *ctrl)
135{ 135{
136 u32 tempdword; 136 u32 tempdword;
137 u32 number_of_slots; 137 u32 number_of_slots;
@@ -291,7 +291,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
291 kfree(slot); 291 kfree(slot);
292} 292}
293 293
294static int ctrl_slot_cleanup (struct controller * ctrl) 294static int ctrl_slot_cleanup (struct controller *ctrl)
295{ 295{
296 struct slot *old_slot, *next_slot; 296 struct slot *old_slot, *next_slot;
297 297
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index f593585f2784..bde47fce3248 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -39,9 +39,9 @@
39#include <linux/kthread.h> 39#include <linux/kthread.h>
40#include "cpqphp.h" 40#include "cpqphp.h"
41 41
42static u32 configure_new_device(struct controller* ctrl, struct pci_func *func, 42static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
43 u8 behind_bridge, struct resource_lists *resources); 43 u8 behind_bridge, struct resource_lists *resources);
44static int configure_new_function(struct controller* ctrl, struct pci_func *func, 44static int configure_new_function(struct controller *ctrl, struct pci_func *func,
45 u8 behind_bridge, struct resource_lists *resources); 45 u8 behind_bridge, struct resource_lists *resources);
46static void interrupt_event_handler(struct controller *ctrl); 46static void interrupt_event_handler(struct controller *ctrl);
47 47
@@ -64,7 +64,7 @@ static void long_delay(int delay)
64 64
65/* FIXME: The following line needs to be somewhere else... */ 65/* FIXME: The following line needs to be somewhere else... */
66#define WRONG_BUS_FREQUENCY 0x07 66#define WRONG_BUS_FREQUENCY 0x07
67static u8 handle_switch_change(u8 change, struct controller * ctrl) 67static u8 handle_switch_change(u8 change, struct controller *ctrl)
68{ 68{
69 int hp_slot; 69 int hp_slot;
70 u8 rc = 0; 70 u8 rc = 0;
@@ -138,7 +138,7 @@ static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device)
138} 138}
139 139
140 140
141static u8 handle_presence_change(u16 change, struct controller * ctrl) 141static u8 handle_presence_change(u16 change, struct controller *ctrl)
142{ 142{
143 int hp_slot; 143 int hp_slot;
144 u8 rc = 0; 144 u8 rc = 0;
@@ -232,7 +232,7 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl)
232} 232}
233 233
234 234
235static u8 handle_power_fault(u8 change, struct controller * ctrl) 235static u8 handle_power_fault(u8 change, struct controller *ctrl)
236{ 236{
237 int hp_slot; 237 int hp_slot;
238 u8 rc = 0; 238 u8 rc = 0;
@@ -997,7 +997,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber)
997 * 997 *
998 * Returns %0 if successful, !0 otherwise. 998 * Returns %0 if successful, !0 otherwise.
999 */ 999 */
1000static int slot_remove(struct pci_func * old_slot) 1000static int slot_remove(struct pci_func *old_slot)
1001{ 1001{
1002 struct pci_func *next; 1002 struct pci_func *next;
1003 1003
@@ -1109,7 +1109,7 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index)
1109 1109
1110/* DJZ: I don't think is_bridge will work as is. 1110/* DJZ: I don't think is_bridge will work as is.
1111 * FIXME */ 1111 * FIXME */
1112static int is_bridge(struct pci_func * func) 1112static int is_bridge(struct pci_func *func)
1113{ 1113{
1114 /* Check the header type */ 1114 /* Check the header type */
1115 if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) 1115 if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01)
@@ -1625,7 +1625,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
1625 * @replace_flag: whether replacing or adding a new device 1625 * @replace_flag: whether replacing or adding a new device
1626 * @ctrl: target controller 1626 * @ctrl: target controller
1627 */ 1627 */
1628static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) 1628static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl)
1629{ 1629{
1630 int index; 1630 int index;
1631 u8 skip = 0; 1631 u8 skip = 0;
@@ -1742,7 +1742,7 @@ static void pushbutton_helper_thread(unsigned long data)
1742 1742
1743 1743
1744/* this is the main worker thread */ 1744/* this is the main worker thread */
1745static int event_thread(void* data) 1745static int event_thread(void *data)
1746{ 1746{
1747 struct controller *ctrl; 1747 struct controller *ctrl;
1748 1748
@@ -1992,7 +1992,7 @@ int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func)
1992 u16 temp_word; 1992 u16 temp_word;
1993 u32 tempdword; 1993 u32 tempdword;
1994 int rc; 1994 int rc;
1995 struct slot* p_slot; 1995 struct slot *p_slot;
1996 int physical_slot = 0; 1996 int physical_slot = 0;
1997 1997
1998 tempdword = 0; 1998 tempdword = 0;
@@ -2088,7 +2088,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func)
2088 u8 replace_flag; 2088 u8 replace_flag;
2089 u32 rc = 0; 2089 u32 rc = 0;
2090 unsigned int devfn; 2090 unsigned int devfn;
2091 struct slot* p_slot; 2091 struct slot *p_slot;
2092 struct pci_bus *pci_bus = ctrl->pci_bus; 2092 struct pci_bus *pci_bus = ctrl->pci_bus;
2093 int physical_slot=0; 2093 int physical_slot=0;
2094 2094
@@ -2270,8 +2270,8 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num)
2270 * 2270 *
2271 * Returns 0 if success. 2271 * Returns 0 if success.
2272 */ 2272 */
2273static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, 2273static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
2274 u8 behind_bridge, struct resource_lists * resources) 2274 u8 behind_bridge, struct resource_lists *resources)
2275{ 2275{
2276 u8 temp_byte, function, max_functions, stop_it; 2276 u8 temp_byte, function, max_functions, stop_it;
2277 int rc; 2277 int rc;
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c
index 9600a392eaae..0968a9bcb345 100644
--- a/drivers/pci/hotplug/cpqphp_nvram.c
+++ b/drivers/pci/hotplug/cpqphp_nvram.c
@@ -107,7 +107,7 @@ static spinlock_t int15_lock;
107 */ 107 */
108 108
109 109
110static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) 110static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, u32 *avail)
111{ 111{
112 u8 **tByte; 112 u8 **tByte;
113 113
@@ -122,7 +122,7 @@ static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail)
122} 122}
123 123
124 124
125static u32 add_dword( u32 **p_buffer, u32 value, u32 *used, u32 *avail) 125static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail)
126{ 126{
127 if ((*used + 4) > *avail) 127 if ((*used + 4) > *avail)
128 return(1); 128 return(1);
@@ -267,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start)
267 ctrl = cpqhp_ctrl_list; 267 ctrl = cpqhp_ctrl_list;
268 268
269 /* The revision of this structure */ 269 /* The revision of this structure */
270 rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); 270 rc = add_byte(&pFill, 1 + ctrl->push_flag, &usedbytes, &available);
271 if (rc) 271 if (rc)
272 return(rc); 272 return(rc);
273 273
274 /* The number of controllers */ 274 /* The number of controllers */
275 rc = add_byte( &pFill, 1, &usedbytes, &available); 275 rc = add_byte(&pFill, 1, &usedbytes, &available);
276 if (rc) 276 if (rc)
277 return(rc); 277 return(rc);
278 278
@@ -282,22 +282,22 @@ static u32 store_HRT (void __iomem *rom_start)
282 numCtrl++; 282 numCtrl++;
283 283
284 /* The bus number */ 284 /* The bus number */
285 rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available); 285 rc = add_byte(&pFill, ctrl->bus, &usedbytes, &available);
286 if (rc) 286 if (rc)
287 return(rc); 287 return(rc);
288 288
289 /* The device Number */ 289 /* The device Number */
290 rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); 290 rc = add_byte(&pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available);
291 if (rc) 291 if (rc)
292 return(rc); 292 return(rc);
293 293
294 /* The function Number */ 294 /* The function Number */
295 rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); 295 rc = add_byte(&pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available);
296 if (rc) 296 if (rc)
297 return(rc); 297 return(rc);
298 298
299 /* Skip the number of available entries */ 299 /* Skip the number of available entries */
300 rc = add_dword( &pFill, 0, &usedbytes, &available); 300 rc = add_dword(&pFill, 0, &usedbytes, &available);
301 if (rc) 301 if (rc)
302 return(rc); 302 return(rc);
303 303
@@ -311,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start)
311 loop ++; 311 loop ++;
312 312
313 /* base */ 313 /* base */
314 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 314 rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
315 if (rc) 315 if (rc)
316 return(rc); 316 return(rc);
317 317
318 /* length */ 318 /* length */
319 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 319 rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
320 if (rc) 320 if (rc)
321 return(rc); 321 return(rc);
322 322
@@ -336,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start)
336 loop ++; 336 loop ++;
337 337
338 /* base */ 338 /* base */
339 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 339 rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
340 if (rc) 340 if (rc)
341 return(rc); 341 return(rc);
342 342
343 /* length */ 343 /* length */
344 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 344 rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
345 if (rc) 345 if (rc)
346 return(rc); 346 return(rc);
347 347
@@ -361,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start)
361 loop ++; 361 loop ++;
362 362
363 /* base */ 363 /* base */
364 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 364 rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
365 if (rc) 365 if (rc)
366 return(rc); 366 return(rc);
367 367
368 /* length */ 368 /* length */
369 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 369 rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
370 if (rc) 370 if (rc)
371 return(rc); 371 return(rc);
372 372
@@ -386,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start)
386 loop ++; 386 loop ++;
387 387
388 /* base */ 388 /* base */
389 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 389 rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
390 if (rc) 390 if (rc)
391 return(rc); 391 return(rc);
392 392
393 /* length */ 393 /* length */
394 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 394 rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
395 if (rc) 395 if (rc)
396 return(rc); 396 return(rc);
397 397
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index a3e3c2002b58..1c8c2f130d31 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -81,7 +81,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom
81} 81}
82 82
83 83
84int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) 84int cpqhp_configure_device (struct controller *ctrl, struct pci_func *func)
85{ 85{
86 struct pci_bus *child; 86 struct pci_bus *child;
87 int num; 87 int num;
@@ -121,7 +121,7 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func)
121} 121}
122 122
123 123
124int cpqhp_unconfigure_device(struct pci_func* func) 124int cpqhp_unconfigure_device(struct pci_func *func)
125{ 125{
126 int j; 126 int j;
127 127
@@ -129,7 +129,7 @@ int cpqhp_unconfigure_device(struct pci_func* func)
129 129
130 pci_lock_rescan_remove(); 130 pci_lock_rescan_remove();
131 for (j=0; j<8 ; j++) { 131 for (j=0; j<8 ; j++) {
132 struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); 132 struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
133 if (temp) { 133 if (temp) {
134 pci_dev_put(temp); 134 pci_dev_put(temp);
135 pci_stop_and_remove_bus_device(temp); 135 pci_stop_and_remove_bus_device(temp);
@@ -203,7 +203,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
203} 203}
204 204
205 205
206static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev_num) 206static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 *dev_num)
207{ 207{
208 u16 tdevice; 208 u16 tdevice;
209 u32 work; 209 u32 work;
@@ -280,7 +280,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
280} 280}
281 281
282 282
283int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 slot) 283int cpqhp_get_bus_dev (struct controller *ctrl, u8 *bus_num, u8 *dev_num, u8 slot)
284{ 284{
285 /* plain (bridges allowed) */ 285 /* plain (bridges allowed) */
286 return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); 286 return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0);
@@ -465,7 +465,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
465 * 465 *
466 * returns 0 if success 466 * returns 0 if success
467 */ 467 */
468int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) 468int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
469{ 469{
470 long rc; 470 long rc;
471 u8 class_code; 471 u8 class_code;
@@ -549,7 +549,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot)
549 * 549 *
550 * returns 0 if success 550 * returns 0 if success
551 */ 551 */
552int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) 552int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
553{ 553{
554 u8 cloop; 554 u8 cloop;
555 u8 header_type; 555 u8 header_type;
@@ -686,7 +686,7 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func)
686 * 686 *
687 * returns 0 if success 687 * returns 0 if success
688 */ 688 */
689int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) 689int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func *func)
690{ 690{
691 u8 cloop; 691 u8 cloop;
692 u8 header_type; 692 u8 header_type;
@@ -949,7 +949,7 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
949 * 949 *
950 * returns 0 if success 950 * returns 0 if success
951 */ 951 */
952int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) 952int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func)
953{ 953{
954 int cloop; 954 int cloop;
955 u8 header_type; 955 u8 header_type;
@@ -1027,7 +1027,7 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func)
1027 * 1027 *
1028 * returns 0 if the board is the same nonzero otherwise 1028 * returns 0 if the board is the same nonzero otherwise
1029 */ 1029 */
1030int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) 1030int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
1031{ 1031{
1032 u8 cloop; 1032 u8 cloop;
1033 u8 header_type; 1033 u8 header_type;
@@ -1419,7 +1419,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
1419 * 1419 *
1420 * returns 0 if success 1420 * returns 0 if success
1421 */ 1421 */
1422int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * resources) 1422int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources)
1423{ 1423{
1424 int rc = 0; 1424 int rc = 0;
1425 struct pci_resource *node; 1425 struct pci_resource *node;
@@ -1475,7 +1475,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists *
1475 * 1475 *
1476 * Puts node back in the resource list pointed to by head 1476 * Puts node back in the resource list pointed to by head
1477 */ 1477 */
1478void cpqhp_destroy_resource_list (struct resource_lists * resources) 1478void cpqhp_destroy_resource_list (struct resource_lists *resources)
1479{ 1479{
1480 struct pci_resource *res, *tres; 1480 struct pci_resource *res, *tres;
1481 1481
@@ -1522,7 +1522,7 @@ void cpqhp_destroy_resource_list (struct resource_lists * resources)
1522 * 1522 *
1523 * Puts node back in the resource list pointed to by head 1523 * Puts node back in the resource list pointed to by head
1524 */ 1524 */
1525void cpqhp_destroy_board_resources (struct pci_func * func) 1525void cpqhp_destroy_board_resources (struct pci_func *func)
1526{ 1526{
1527 struct pci_resource *res, *tres; 1527 struct pci_resource *res, *tres;
1528 1528
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index 17c1f36315d1..4a392c44e3d3 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -79,7 +79,7 @@ static int show_ctrl (struct controller *ctrl, char *buf)
79 79
80static int show_dev (struct controller *ctrl, char *buf) 80static int show_dev (struct controller *ctrl, char *buf)
81{ 81{
82 char * out = buf; 82 char *out = buf;
83 int index; 83 int index;
84 struct pci_resource *res; 84 struct pci_resource *res;
85 struct pci_func *new_slot; 85 struct pci_func *new_slot;
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index cf3ac1e4b099..5794057f7ec1 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -74,7 +74,7 @@ static inline int get_max_adapter_speed (struct hotplug_slot *hs, u8 *value)
74static inline int get_cur_bus_info(struct slot **sl) 74static inline int get_cur_bus_info(struct slot **sl)
75{ 75{
76 int rc = 1; 76 int rc = 1;
77 struct slot * slot_cur = *sl; 77 struct slot *slot_cur = *sl;
78 78
79 debug("options = %x\n", slot_cur->ctrl->options); 79 debug("options = %x\n", slot_cur->ctrl->options);
80 debug("revision = %x\n", slot_cur->ctrl->revision); 80 debug("revision = %x\n", slot_cur->ctrl->revision);
@@ -114,8 +114,8 @@ static inline int slot_update(struct slot **sl)
114 114
115static int __init get_max_slots (void) 115static int __init get_max_slots (void)
116{ 116{
117 struct slot * slot_cur; 117 struct slot *slot_cur;
118 struct list_head * tmp; 118 struct list_head *tmp;
119 u8 slot_count = 0; 119 u8 slot_count = 0;
120 120
121 list_for_each(tmp, &ibmphp_slot_head) { 121 list_for_each(tmp, &ibmphp_slot_head) {
@@ -280,7 +280,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
280 return rc; 280 return rc;
281} 281}
282 282
283static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) 283static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
284{ 284{
285 int rc = -ENODEV; 285 int rc = -ENODEV;
286 struct slot *pslot; 286 struct slot *pslot;
@@ -311,7 +311,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
311 return rc; 311 return rc;
312} 312}
313 313
314static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) 314static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
315{ 315{
316 int rc = -ENODEV; 316 int rc = -ENODEV;
317 struct slot *pslot; 317 struct slot *pslot;
@@ -338,7 +338,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value)
338} 338}
339 339
340 340
341static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) 341static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
342{ 342{
343 int rc = -ENODEV; 343 int rc = -ENODEV;
344 struct slot *pslot; 344 struct slot *pslot;
@@ -364,7 +364,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
364 return rc; 364 return rc;
365} 365}
366 366
367static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 * value) 367static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 *value)
368{ 368{
369 int rc = -ENODEV; 369 int rc = -ENODEV;
370 struct slot *pslot; 370 struct slot *pslot;
@@ -433,7 +433,7 @@ static int get_max_bus_speed(struct slot *slot)
433} 433}
434 434
435/* 435/*
436static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value, u8 flag) 436static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 *value, u8 flag)
437{ 437{
438 int rc = -ENODEV; 438 int rc = -ENODEV;
439 struct slot *pslot; 439 struct slot *pslot;
@@ -471,7 +471,7 @@ static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value
471 return rc; 471 return rc;
472} 472}
473 473
474static int get_bus_name(struct hotplug_slot *hotplug_slot, char * value) 474static int get_bus_name(struct hotplug_slot *hotplug_slot, char *value)
475{ 475{
476 int rc = -ENODEV; 476 int rc = -ENODEV;
477 struct slot *pslot = NULL; 477 struct slot *pslot = NULL;
@@ -671,7 +671,7 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
671{ 671{
672 struct pci_func *func_cur; 672 struct pci_func *func_cur;
673 struct slot *slot_cur; 673 struct slot *slot_cur;
674 struct list_head * tmp; 674 struct list_head *tmp;
675 list_for_each(tmp, &ibmphp_slot_head) { 675 list_for_each(tmp, &ibmphp_slot_head) {
676 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); 676 slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
677 if (slot_cur->func) { 677 if (slot_cur->func) {
@@ -696,8 +696,8 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
696static void free_slots(void) 696static void free_slots(void)
697{ 697{
698 struct slot *slot_cur; 698 struct slot *slot_cur;
699 struct list_head * tmp; 699 struct list_head *tmp;
700 struct list_head * next; 700 struct list_head *next;
701 701
702 debug("%s -- enter\n", __func__); 702 debug("%s -- enter\n", __func__);
703 703
@@ -825,10 +825,10 @@ static int ibm_configure_device(struct pci_func *func)
825/******************************************************* 825/*******************************************************
826 * Returns whether the bus is empty or not 826 * Returns whether the bus is empty or not
827 *******************************************************/ 827 *******************************************************/
828static int is_bus_empty(struct slot * slot_cur) 828static int is_bus_empty(struct slot *slot_cur)
829{ 829{
830 int rc; 830 int rc;
831 struct slot * tmp_slot; 831 struct slot *tmp_slot;
832 u8 i = slot_cur->bus_on->slot_min; 832 u8 i = slot_cur->bus_on->slot_min;
833 833
834 while (i <= slot_cur->bus_on->slot_max) { 834 while (i <= slot_cur->bus_on->slot_max) {
@@ -856,7 +856,7 @@ static int is_bus_empty(struct slot * slot_cur)
856 * Parameters: slot 856 * Parameters: slot
857 * Returns: bus is set (0) or error code 857 * Returns: bus is set (0) or error code
858 ***********************************************************/ 858 ***********************************************************/
859static int set_bus(struct slot * slot_cur) 859static int set_bus(struct slot *slot_cur)
860{ 860{
861 int rc; 861 int rc;
862 u8 speed; 862 u8 speed;
@@ -956,7 +956,7 @@ static int set_bus(struct slot * slot_cur)
956static int check_limitations(struct slot *slot_cur) 956static int check_limitations(struct slot *slot_cur)
957{ 957{
958 u8 i; 958 u8 i;
959 struct slot * tmp_slot; 959 struct slot *tmp_slot;
960 u8 count = 0; 960 u8 count = 0;
961 u8 limitation = 0; 961 u8 limitation = 0;
962 962
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index bd044158b36c..0f65ac555434 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -563,7 +563,7 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var)
563 return rc; 563 return rc;
564} 564}
565 565
566static struct opt_rio_lo * find_rxe_num (u8 slot_num) 566static struct opt_rio_lo *find_rxe_num (u8 slot_num)
567{ 567{
568 struct opt_rio_lo *opt_lo_ptr; 568 struct opt_rio_lo *opt_lo_ptr;
569 569
@@ -575,7 +575,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num)
575 return NULL; 575 return NULL;
576} 576}
577 577
578static struct opt_rio * find_chassis_num (u8 slot_num) 578static struct opt_rio *find_chassis_num (u8 slot_num)
579{ 579{
580 struct opt_rio *opt_vg_ptr; 580 struct opt_rio *opt_vg_ptr;
581 581
@@ -593,7 +593,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num)
593static u8 calculate_first_slot (u8 slot_num) 593static u8 calculate_first_slot (u8 slot_num)
594{ 594{
595 u8 first_slot = 1; 595 u8 first_slot = 1;
596 struct slot * slot_cur; 596 struct slot *slot_cur;
597 597
598 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) { 598 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
599 if (slot_cur->ctrl) { 599 if (slot_cur->ctrl) {
@@ -607,7 +607,7 @@ static u8 calculate_first_slot (u8 slot_num)
607 607
608#define SLOT_NAME_SIZE 30 608#define SLOT_NAME_SIZE 30
609 609
610static char *create_file_name (struct slot * slot_cur) 610static char *create_file_name (struct slot *slot_cur)
611{ 611{
612 struct opt_rio *opt_vg_ptr = NULL; 612 struct opt_rio *opt_vg_ptr = NULL;
613 struct opt_rio_lo *opt_lo_ptr = NULL; 613 struct opt_rio_lo *opt_lo_ptr = NULL;
@@ -1192,7 +1192,7 @@ int ibmphp_register_pci (void)
1192 } 1192 }
1193 return rc; 1193 return rc;
1194} 1194}
1195static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) 1195static int ibmphp_probe (struct pci_dev *dev, const struct pci_device_id *ids)
1196{ 1196{
1197 struct controller *ctrl; 1197 struct controller *ctrl;
1198 1198
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 5fc7a089f532..a936022956e6 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -533,7 +533,7 @@ static u8 hpc_readcmdtoindex (u8 cmd, u8 index)
533* 533*
534* Return 0 or error codes 534* Return 0 or error codes
535*---------------------------------------------------------------------*/ 535*---------------------------------------------------------------------*/
536int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) 536int ibmphp_hpc_readslot (struct slot *pslot, u8 cmd, u8 *pstatus)
537{ 537{
538 void __iomem *wpg_bbar = NULL; 538 void __iomem *wpg_bbar = NULL;
539 struct controller *ctlr_ptr; 539 struct controller *ctlr_ptr;
@@ -672,7 +672,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus)
672* 672*
673* Action: issue a WRITE command to HPC 673* Action: issue a WRITE command to HPC
674*---------------------------------------------------------------------*/ 674*---------------------------------------------------------------------*/
675int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) 675int ibmphp_hpc_writeslot (struct slot *pslot, u8 cmd)
676{ 676{
677 void __iomem *wpg_bbar = NULL; 677 void __iomem *wpg_bbar = NULL;
678 struct controller *ctlr_ptr; 678 struct controller *ctlr_ptr;
@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
1102* Value: 1102* Value:
1103*---------------------------------------------------------------------*/ 1103*---------------------------------------------------------------------*/
1104static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar, 1104static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar,
1105 u8 * pstatus) 1105 u8 *pstatus)
1106{ 1106{
1107 int rc = 0; 1107 int rc = 0;
1108 u8 done = 0; 1108 u8 done = 0;
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
index 639ea3a75e14..f53b7c5b9a3f 100644
--- a/drivers/pci/hotplug/ibmphp_pci.c
+++ b/drivers/pci/hotplug/ibmphp_pci.c
@@ -47,7 +47,7 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno);
47 * We also assign the same irq numbers for multi function devices. 47 * We also assign the same irq numbers for multi function devices.
48 * These are PIC mode, so shouldn't matter n.e.ways (hopefully) 48 * These are PIC mode, so shouldn't matter n.e.ways (hopefully)
49 */ 49 */
50static void assign_alt_irq (struct pci_func * cur_func, u8 class_code) 50static void assign_alt_irq (struct pci_func *cur_func, u8 class_code)
51{ 51{
52 int j; 52 int j;
53 for (j = 0; j < 4; j++) { 53 for (j = 0; j < 4; j++) {
@@ -1073,7 +1073,7 @@ error:
1073 * Input: bridge function 1073 * Input: bridge function
1074 * Output: amount of resources needed 1074 * Output: amount of resources needed
1075 *****************************************************************************/ 1075 *****************************************************************************/
1076static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) 1076static struct res_needed *scan_behind_bridge (struct pci_func *func, u8 busno)
1077{ 1077{
1078 int count, len[6]; 1078 int count, len[6];
1079 u16 vendor_id; 1079 u16 vendor_id;
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c
index a265acb2d518..f62dfc40f753 100644
--- a/drivers/pci/hotplug/ibmphp_res.c
+++ b/drivers/pci/hotplug/ibmphp_res.c
@@ -46,9 +46,9 @@ static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8);
46 46
47static LIST_HEAD(gbuses); 47static LIST_HEAD(gbuses);
48 48
49static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag) 49static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc *curr, u8 busno, int flag)
50{ 50{
51 struct bus_node * newbus; 51 struct bus_node *newbus;
52 52
53 if (!(curr) && !(flag)) { 53 if (!(curr) && !(flag)) {
54 err ("NULL pointer passed\n"); 54 err ("NULL pointer passed\n");
@@ -69,7 +69,7 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
69 return newbus; 69 return newbus;
70} 70}
71 71
72static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr) 72static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc *curr)
73{ 73{
74 struct resource_node *rs; 74 struct resource_node *rs;
75 75
@@ -93,7 +93,7 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur
93 93
94static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus) 94static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus)
95{ 95{
96 struct bus_node * newbus; 96 struct bus_node *newbus;
97 struct range_node *newrange; 97 struct range_node *newrange;
98 u8 num_ranges = 0; 98 u8 num_ranges = 0;
99 99
@@ -934,9 +934,9 @@ int ibmphp_remove_resource (struct resource_node *res)
934 return 0; 934 return 0;
935} 935}
936 936
937static struct range_node * find_range (struct bus_node *bus_cur, struct resource_node * res) 937static struct range_node *find_range (struct bus_node *bus_cur, struct resource_node *res)
938{ 938{
939 struct range_node * range = NULL; 939 struct range_node *range = NULL;
940 940
941 switch (res->type) { 941 switch (res->type) {
942 case IO: 942 case IO:
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index ef496457f8d0..29caef96a21c 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -59,14 +59,12 @@ static bool debug;
59#define DRIVER_DESC "PCI Hot Plug PCI Core" 59#define DRIVER_DESC "PCI Hot Plug PCI Core"
60 60
61 61
62//////////////////////////////////////////////////////////////////
63
64static LIST_HEAD(pci_hotplug_slot_list); 62static LIST_HEAD(pci_hotplug_slot_list);
65static DEFINE_MUTEX(pci_hp_mutex); 63static DEFINE_MUTEX(pci_hp_mutex);
66 64
67/* Weee, fun with macros... */ 65/* Weee, fun with macros... */
68#define GET_STATUS(name,type) \ 66#define GET_STATUS(name, type) \
69static int get_##name (struct hotplug_slot *slot, type *value) \ 67static int get_##name(struct hotplug_slot *slot, type *value) \
70{ \ 68{ \
71 struct hotplug_slot_ops *ops = slot->ops; \ 69 struct hotplug_slot_ops *ops = slot->ops; \
72 int retval = 0; \ 70 int retval = 0; \
@@ -92,42 +90,41 @@ static ssize_t power_read_file(struct pci_slot *slot, char *buf)
92 90
93 retval = get_power_status(slot->hotplug, &value); 91 retval = get_power_status(slot->hotplug, &value);
94 if (retval) 92 if (retval)
95 goto exit; 93 return retval;
96 retval = sprintf (buf, "%d\n", value); 94
97exit: 95 return sprintf(buf, "%d\n", value);
98 return retval;
99} 96}
100 97
101static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, 98static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
102 size_t count) 99 size_t count)
103{ 100{
104 struct hotplug_slot *slot = pci_slot->hotplug; 101 struct hotplug_slot *slot = pci_slot->hotplug;
105 unsigned long lpower; 102 unsigned long lpower;
106 u8 power; 103 u8 power;
107 int retval = 0; 104 int retval = 0;
108 105
109 lpower = simple_strtoul (buf, NULL, 10); 106 lpower = simple_strtoul(buf, NULL, 10);
110 power = (u8)(lpower & 0xff); 107 power = (u8)(lpower & 0xff);
111 dbg ("power = %d\n", power); 108 dbg("power = %d\n", power);
112 109
113 if (!try_module_get(slot->ops->owner)) { 110 if (!try_module_get(slot->ops->owner)) {
114 retval = -ENODEV; 111 retval = -ENODEV;
115 goto exit; 112 goto exit;
116 } 113 }
117 switch (power) { 114 switch (power) {
118 case 0: 115 case 0:
119 if (slot->ops->disable_slot) 116 if (slot->ops->disable_slot)
120 retval = slot->ops->disable_slot(slot); 117 retval = slot->ops->disable_slot(slot);
121 break; 118 break;
122 119
123 case 1: 120 case 1:
124 if (slot->ops->enable_slot) 121 if (slot->ops->enable_slot)
125 retval = slot->ops->enable_slot(slot); 122 retval = slot->ops->enable_slot(slot);
126 break; 123 break;
127 124
128 default: 125 default:
129 err ("Illegal value specified for power\n"); 126 err("Illegal value specified for power\n");
130 retval = -EINVAL; 127 retval = -EINVAL;
131 } 128 }
132 module_put(slot->ops->owner); 129 module_put(slot->ops->owner);
133 130
@@ -150,24 +147,22 @@ static ssize_t attention_read_file(struct pci_slot *slot, char *buf)
150 147
151 retval = get_attention_status(slot->hotplug, &value); 148 retval = get_attention_status(slot->hotplug, &value);
152 if (retval) 149 if (retval)
153 goto exit; 150 return retval;
154 retval = sprintf(buf, "%d\n", value);
155 151
156exit: 152 return sprintf(buf, "%d\n", value);
157 return retval;
158} 153}
159 154
160static ssize_t attention_write_file(struct pci_slot *slot, const char *buf, 155static ssize_t attention_write_file(struct pci_slot *slot, const char *buf,
161 size_t count) 156 size_t count)
162{ 157{
163 struct hotplug_slot_ops *ops = slot->hotplug->ops; 158 struct hotplug_slot_ops *ops = slot->hotplug->ops;
164 unsigned long lattention; 159 unsigned long lattention;
165 u8 attention; 160 u8 attention;
166 int retval = 0; 161 int retval = 0;
167 162
168 lattention = simple_strtoul (buf, NULL, 10); 163 lattention = simple_strtoul(buf, NULL, 10);
169 attention = (u8)(lattention & 0xff); 164 attention = (u8)(lattention & 0xff);
170 dbg (" - attention = %d\n", attention); 165 dbg(" - attention = %d\n", attention);
171 166
172 if (!try_module_get(ops->owner)) { 167 if (!try_module_get(ops->owner)) {
173 retval = -ENODEV; 168 retval = -ENODEV;
@@ -196,11 +191,9 @@ static ssize_t latch_read_file(struct pci_slot *slot, char *buf)
196 191
197 retval = get_latch_status(slot->hotplug, &value); 192 retval = get_latch_status(slot->hotplug, &value);
198 if (retval) 193 if (retval)
199 goto exit; 194 return retval;
200 retval = sprintf (buf, "%d\n", value);
201 195
202exit: 196 return sprintf(buf, "%d\n", value);
203 return retval;
204} 197}
205 198
206static struct pci_slot_attribute hotplug_slot_attr_latch = { 199static struct pci_slot_attribute hotplug_slot_attr_latch = {
@@ -215,11 +208,9 @@ static ssize_t presence_read_file(struct pci_slot *slot, char *buf)
215 208
216 retval = get_adapter_status(slot->hotplug, &value); 209 retval = get_adapter_status(slot->hotplug, &value);
217 if (retval) 210 if (retval)
218 goto exit; 211 return retval;
219 retval = sprintf (buf, "%d\n", value);
220 212
221exit: 213 return sprintf(buf, "%d\n", value);
222 return retval;
223} 214}
224 215
225static struct pci_slot_attribute hotplug_slot_attr_presence = { 216static struct pci_slot_attribute hotplug_slot_attr_presence = {
@@ -228,7 +219,7 @@ static struct pci_slot_attribute hotplug_slot_attr_presence = {
228}; 219};
229 220
230static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, 221static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
231 size_t count) 222 size_t count)
232{ 223{
233 struct hotplug_slot *slot = pci_slot->hotplug; 224 struct hotplug_slot *slot = pci_slot->hotplug;
234 unsigned long ltest; 225 unsigned long ltest;
@@ -237,7 +228,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
237 228
238 ltest = simple_strtoul (buf, NULL, 10); 229 ltest = simple_strtoul (buf, NULL, 10);
239 test = (u32)(ltest & 0xffffffff); 230 test = (u32)(ltest & 0xffffffff);
240 dbg ("test = %d\n", test); 231 dbg("test = %d\n", test);
241 232
242 if (!try_module_get(slot->ops->owner)) { 233 if (!try_module_get(slot->ops->owner)) {
243 retval = -ENODEV; 234 retval = -ENODEV;
@@ -261,6 +252,7 @@ static struct pci_slot_attribute hotplug_slot_attr_test = {
261static bool has_power_file(struct pci_slot *pci_slot) 252static bool has_power_file(struct pci_slot *pci_slot)
262{ 253{
263 struct hotplug_slot *slot = pci_slot->hotplug; 254 struct hotplug_slot *slot = pci_slot->hotplug;
255
264 if ((!slot) || (!slot->ops)) 256 if ((!slot) || (!slot->ops))
265 return false; 257 return false;
266 if ((slot->ops->enable_slot) || 258 if ((slot->ops->enable_slot) ||
@@ -273,6 +265,7 @@ static bool has_power_file(struct pci_slot *pci_slot)
273static bool has_attention_file(struct pci_slot *pci_slot) 265static bool has_attention_file(struct pci_slot *pci_slot)
274{ 266{
275 struct hotplug_slot *slot = pci_slot->hotplug; 267 struct hotplug_slot *slot = pci_slot->hotplug;
268
276 if ((!slot) || (!slot->ops)) 269 if ((!slot) || (!slot->ops))
277 return false; 270 return false;
278 if ((slot->ops->set_attention_status) || 271 if ((slot->ops->set_attention_status) ||
@@ -284,6 +277,7 @@ static bool has_attention_file(struct pci_slot *pci_slot)
284static bool has_latch_file(struct pci_slot *pci_slot) 277static bool has_latch_file(struct pci_slot *pci_slot)
285{ 278{
286 struct hotplug_slot *slot = pci_slot->hotplug; 279 struct hotplug_slot *slot = pci_slot->hotplug;
280
287 if ((!slot) || (!slot->ops)) 281 if ((!slot) || (!slot->ops))
288 return false; 282 return false;
289 if (slot->ops->get_latch_status) 283 if (slot->ops->get_latch_status)
@@ -294,6 +288,7 @@ static bool has_latch_file(struct pci_slot *pci_slot)
294static bool has_adapter_file(struct pci_slot *pci_slot) 288static bool has_adapter_file(struct pci_slot *pci_slot)
295{ 289{
296 struct hotplug_slot *slot = pci_slot->hotplug; 290 struct hotplug_slot *slot = pci_slot->hotplug;
291
297 if ((!slot) || (!slot->ops)) 292 if ((!slot) || (!slot->ops))
298 return false; 293 return false;
299 if (slot->ops->get_adapter_status) 294 if (slot->ops->get_adapter_status)
@@ -304,6 +299,7 @@ static bool has_adapter_file(struct pci_slot *pci_slot)
304static bool has_test_file(struct pci_slot *pci_slot) 299static bool has_test_file(struct pci_slot *pci_slot)
305{ 300{
306 struct hotplug_slot *slot = pci_slot->hotplug; 301 struct hotplug_slot *slot = pci_slot->hotplug;
302
307 if ((!slot) || (!slot->ops)) 303 if ((!slot) || (!slot->ops))
308 return false; 304 return false;
309 if (slot->ops->hardware_test) 305 if (slot->ops->hardware_test)
@@ -397,13 +393,13 @@ static void fs_remove_slot(struct pci_slot *slot)
397 pci_hp_remove_module_link(slot); 393 pci_hp_remove_module_link(slot);
398} 394}
399 395
400static struct hotplug_slot *get_slot_from_name (const char *name) 396static struct hotplug_slot *get_slot_from_name(const char *name)
401{ 397{
402 struct hotplug_slot *slot; 398 struct hotplug_slot *slot;
403 struct list_head *tmp; 399 struct list_head *tmp;
404 400
405 list_for_each (tmp, &pci_hotplug_slot_list) { 401 list_for_each(tmp, &pci_hotplug_slot_list) {
406 slot = list_entry (tmp, struct hotplug_slot, slot_list); 402 slot = list_entry(tmp, struct hotplug_slot, slot_list);
407 if (strcmp(hotplug_slot_name(slot), name) == 0) 403 if (strcmp(hotplug_slot_name(slot), name) == 0)
408 return slot; 404 return slot;
409 } 405 }
@@ -531,23 +527,21 @@ int pci_hp_change_slot_info(struct hotplug_slot *hotplug,
531} 527}
532EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); 528EXPORT_SYMBOL_GPL(pci_hp_change_slot_info);
533 529
534static int __init pci_hotplug_init (void) 530static int __init pci_hotplug_init(void)
535{ 531{
536 int result; 532 int result;
537 533
538 result = cpci_hotplug_init(debug); 534 result = cpci_hotplug_init(debug);
539 if (result) { 535 if (result) {
540 err ("cpci_hotplug_init with error %d\n", result); 536 err("cpci_hotplug_init with error %d\n", result);
541 goto err_cpci; 537 return result;
542 } 538 }
543 539
544 info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); 540 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
545
546err_cpci:
547 return result; 541 return result;
548} 542}
549 543
550static void __exit pci_hotplug_exit (void) 544static void __exit pci_hotplug_exit(void)
551{ 545{
552 cpci_hotplug_exit(); 546 cpci_hotplug_exit();
553} 547}
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c
index 20fea57d2149..93cc9266e8cb 100644
--- a/drivers/pci/hotplug/pciehp_acpi.c
+++ b/drivers/pci/hotplug/pciehp_acpi.c
@@ -103,10 +103,10 @@ static int __init dummy_probe(struct pcie_device *dev)
103} 103}
104 104
105static struct pcie_port_service_driver __initdata dummy_driver = { 105static struct pcie_port_service_driver __initdata dummy_driver = {
106 .name = "pciehp_dummy", 106 .name = "pciehp_dummy",
107 .port_type = PCIE_ANY_PORT, 107 .port_type = PCIE_ANY_PORT,
108 .service = PCIE_PORT_SERVICE_HP, 108 .service = PCIE_PORT_SERVICE_HP,
109 .probe = dummy_probe, 109 .probe = dummy_probe,
110}; 110};
111 111
112static int __init select_detection_mode(void) 112static int __init select_detection_mode(void)
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 0e0a2fff20a3..96bb617e4de5 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -312,12 +312,12 @@ static void pciehp_remove(struct pcie_device *dev)
312} 312}
313 313
314#ifdef CONFIG_PM 314#ifdef CONFIG_PM
315static int pciehp_suspend (struct pcie_device *dev) 315static int pciehp_suspend(struct pcie_device *dev)
316{ 316{
317 return 0; 317 return 0;
318} 318}
319 319
320static int pciehp_resume (struct pcie_device *dev) 320static int pciehp_resume(struct pcie_device *dev)
321{ 321{
322 struct controller *ctrl; 322 struct controller *ctrl;
323 struct slot *slot; 323 struct slot *slot;
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index c75e6a678dcc..c57463e1d756 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -175,7 +175,7 @@ void pciehp_handle_linkstate_change(struct slot *p_slot)
175 hotplug controller logic 175 hotplug controller logic
176 */ 176 */
177 177
178static void set_slot_off(struct controller *ctrl, struct slot * pslot) 178static void set_slot_off(struct controller *ctrl, struct slot *pslot)
179{ 179{
180 /* turn off slot, turn on Amber LED, turn off Green LED if supported*/ 180 /* turn off slot, turn on Amber LED, turn off Green LED if supported*/
181 if (POWER_CTRL(ctrl)) { 181 if (POWER_CTRL(ctrl)) {
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 1463412cf7f8..9334fc76b9d1 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -203,7 +203,7 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
203 if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) || 203 if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) ||
204 !(slot_ctrl & PCI_EXP_SLTCTL_CCIE)) 204 !(slot_ctrl & PCI_EXP_SLTCTL_CCIE))
205 poll = 1; 205 poll = 1;
206 pcie_wait_cmd(ctrl, poll); 206 pcie_wait_cmd(ctrl, poll);
207 } 207 }
208 mutex_unlock(&ctrl->ctrl_lock); 208 mutex_unlock(&ctrl->ctrl_lock);
209} 209}
@@ -276,15 +276,15 @@ int pciehp_check_link_status(struct controller *ctrl)
276 bool found; 276 bool found;
277 u16 lnk_status; 277 u16 lnk_status;
278 278
279 /* 279 /*
280 * Data Link Layer Link Active Reporting must be capable for 280 * Data Link Layer Link Active Reporting must be capable for
281 * hot-plug capable downstream port. But old controller might 281 * hot-plug capable downstream port. But old controller might
282 * not implement it. In this case, we wait for 1000 ms. 282 * not implement it. In this case, we wait for 1000 ms.
283 */ 283 */
284 if (ctrl->link_active_reporting) 284 if (ctrl->link_active_reporting)
285 pcie_wait_link_active(ctrl); 285 pcie_wait_link_active(ctrl);
286 else 286 else
287 msleep(1000); 287 msleep(1000);
288 288
289 /* wait 100ms before read pci conf, and try in 1s */ 289 /* wait 100ms before read pci conf, and try in 1s */
290 msleep(100); 290 msleep(100);
@@ -295,7 +295,7 @@ int pciehp_check_link_status(struct controller *ctrl)
295 ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); 295 ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
296 if ((lnk_status & PCI_EXP_LNKSTA_LT) || 296 if ((lnk_status & PCI_EXP_LNKSTA_LT) ||
297 !(lnk_status & PCI_EXP_LNKSTA_NLW)) { 297 !(lnk_status & PCI_EXP_LNKSTA_NLW)) {
298 ctrl_err(ctrl, "Link Training Error occurs \n"); 298 ctrl_err(ctrl, "Link Training Error occurs\n");
299 return -1; 299 return -1;
300 } 300 }
301 301
@@ -414,7 +414,7 @@ void pciehp_set_attention_status(struct slot *slot, u8 value)
414 return; 414 return;
415 415
416 switch (value) { 416 switch (value) {
417 case 0 : /* turn off */ 417 case 0: /* turn off */
418 slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF; 418 slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF;
419 break; 419 break;
420 case 1: /* turn on */ 420 case 1: /* turn on */
@@ -470,7 +470,7 @@ void pciehp_green_led_blink(struct slot *slot)
470 PCI_EXP_SLTCTL_PWR_IND_BLINK); 470 PCI_EXP_SLTCTL_PWR_IND_BLINK);
471} 471}
472 472
473int pciehp_power_on_slot(struct slot * slot) 473int pciehp_power_on_slot(struct slot *slot)
474{ 474{
475 struct controller *ctrl = slot->ctrl; 475 struct controller *ctrl = slot->ctrl;
476 struct pci_dev *pdev = ctrl_dev(ctrl); 476 struct pci_dev *pdev = ctrl_dev(ctrl);
@@ -496,7 +496,7 @@ int pciehp_power_on_slot(struct slot * slot)
496 return retval; 496 return retval;
497} 497}
498 498
499void pciehp_power_off_slot(struct slot * slot) 499void pciehp_power_off_slot(struct slot *slot)
500{ 500{
501 struct controller *ctrl = slot->ctrl; 501 struct controller *ctrl = slot->ctrl;
502 502
@@ -756,7 +756,7 @@ static inline void dbg_ctrl(struct controller *ctrl)
756 ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16); 756 ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16);
757} 757}
758 758
759#define FLAG(x,y) (((x) & (y)) ? '+' : '-') 759#define FLAG(x, y) (((x) & (y)) ? '+' : '-')
760 760
761struct controller *pcie_init(struct pcie_device *dev) 761struct controller *pcie_init(struct pcie_device *dev)
762{ 762{
@@ -783,14 +783,14 @@ struct controller *pcie_init(struct pcie_device *dev)
783 */ 783 */
784 if (NO_CMD_CMPL(ctrl) || 784 if (NO_CMD_CMPL(ctrl) ||
785 !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl))) 785 !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl)))
786 ctrl->no_cmd_complete = 1; 786 ctrl->no_cmd_complete = 1;
787 787
788 /* Check if Data Link Layer Link Active Reporting is implemented */ 788 /* Check if Data Link Layer Link Active Reporting is implemented */
789 pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); 789 pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap);
790 if (link_cap & PCI_EXP_LNKCAP_DLLLARC) { 790 if (link_cap & PCI_EXP_LNKCAP_DLLLARC) {
791 ctrl_dbg(ctrl, "Link Active Reporting supported\n"); 791 ctrl_dbg(ctrl, "Link Active Reporting supported\n");
792 ctrl->link_active_reporting = 1; 792 ctrl->link_active_reporting = 1;
793 } 793 }
794 794
795 /* Clear all remaining event bits in Slot Status register */ 795 /* Clear all remaining event bits in Slot Status register */
796 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, 796 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
index ac69094e4b20..d062c008fc95 100644
--- a/drivers/pci/hotplug/pcihp_skeleton.c
+++ b/drivers/pci/hotplug/pcihp_skeleton.c
@@ -51,7 +51,7 @@ static LIST_HEAD(slot_list);
51#define dbg(format, arg...) \ 51#define dbg(format, arg...) \
52 do { \ 52 do { \
53 if (debug) \ 53 if (debug) \
54 printk (KERN_DEBUG "%s: " format "\n", \ 54 printk(KERN_DEBUG "%s: " format "\n", \
55 MY_NAME , ## arg); \ 55 MY_NAME , ## arg); \
56 } while (0) 56 } while (0)
57#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 57#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
@@ -128,18 +128,18 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
128 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); 128 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
129 129
130 switch (status) { 130 switch (status) {
131 case 0: 131 case 0:
132 /* 132 /*
133 * Fill in code here to turn light off 133 * Fill in code here to turn light off
134 */ 134 */
135 break; 135 break;
136 136
137 case 1: 137 case 1:
138 default: 138 default:
139 /* 139 /*
140 * Fill in code here to turn light on 140 * Fill in code here to turn light on
141 */ 141 */
142 break; 142 break;
143 } 143 }
144 144
145 return retval; 145 return retval;
@@ -153,12 +153,12 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value)
153 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); 153 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
154 154
155 switch (value) { 155 switch (value) {
156 case 0: 156 case 0:
157 /* Specify a test here */ 157 /* Specify a test here */
158 break; 158 break;
159 case 1: 159 case 1:
160 /* Specify another test here */ 160 /* Specify another test here */
161 break; 161 break;
162 } 162 }
163 163
164 return retval; 164 return retval;
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index f2abfc6ec7c8..93aa29f6d39c 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -89,7 +89,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
89 * @hotplug_slot: slot to get status 89 * @hotplug_slot: slot to get status
90 * @value: pointer to store status 90 * @value: pointer to store status
91 */ 91 */
92static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) 92static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
93{ 93{
94 int retval, level; 94 int retval, level;
95 struct slot *slot = (struct slot *)hotplug_slot->private; 95 struct slot *slot = (struct slot *)hotplug_slot->private;
@@ -105,14 +105,14 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
105 * @hotplug_slot: slot to get status 105 * @hotplug_slot: slot to get status
106 * @value: pointer to store status 106 * @value: pointer to store status
107 */ 107 */
108static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) 108static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
109{ 109{
110 struct slot *slot = (struct slot *)hotplug_slot->private; 110 struct slot *slot = (struct slot *)hotplug_slot->private;
111 *value = slot->hotplug_slot->info->attention_status; 111 *value = slot->hotplug_slot->info->attention_status;
112 return 0; 112 return 0;
113} 113}
114 114
115static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) 115static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
116{ 116{
117 struct slot *slot = (struct slot *)hotplug_slot->private; 117 struct slot *slot = (struct slot *)hotplug_slot->private;
118 int rc, state; 118 int rc, state;
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 613043f7576f..0f4c36033ade 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -188,7 +188,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
188 return 0; 188 return 0;
189} 189}
190 190
191static struct hotplug_slot * sn_hp_destroy(void) 191static struct hotplug_slot *sn_hp_destroy(void)
192{ 192{
193 struct slot *slot; 193 struct slot *slot;
194 struct pci_slot *pci_slot; 194 struct pci_slot *pci_slot;
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 61529097464d..5897d516427b 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -180,7 +180,7 @@ int shpchp_configure_device(struct slot *p_slot);
180int shpchp_unconfigure_device(struct slot *p_slot); 180int shpchp_unconfigure_device(struct slot *p_slot);
181void cleanup_slots(struct controller *ctrl); 181void cleanup_slots(struct controller *ctrl);
182void shpchp_queue_pushbutton_work(struct work_struct *work); 182void shpchp_queue_pushbutton_work(struct work_struct *work);
183int shpc_init( struct controller *ctrl, struct pci_dev *pdev); 183int shpc_init(struct controller *ctrl, struct pci_dev *pdev);
184 184
185static inline const char *slot_name(struct slot *slot) 185static inline const char *slot_name(struct slot *slot)
186{ 186{
@@ -295,7 +295,7 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot)
295 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); 295 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set);
296 } 296 }
297 /* restore MiscII register */ 297 /* restore MiscII register */
298 pci_read_config_dword( p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp ); 298 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp );
299 299
300 if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK) 300 if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK)
301 pcix_misc2_temp |= SERRFATALENABLE_MASK; 301 pcix_misc2_temp |= SERRFATALENABLE_MASK;
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 58499277903a..90cd75c1a3a7 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -162,7 +162,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl)
162 162
163 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 163 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
164 164
165 if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { 165 if (!(p_slot->hpc_ops->query_power_fault(p_slot))) {
166 /* 166 /*
167 * Power fault Cleared 167 * Power fault Cleared
168 */ 168 */
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index 2d7f474ca0ec..12aa9e2b78aa 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -404,7 +404,7 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status)
404 return 0; 404 return 0;
405} 405}
406 406
407static int hpc_get_power_status(struct slot * slot, u8 *status) 407static int hpc_get_power_status(struct slot *slot, u8 *status)
408{ 408{
409 struct controller *ctrl = slot->ctrl; 409 struct controller *ctrl = slot->ctrl;
410 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); 410 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot));
@@ -528,7 +528,7 @@ static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode)
528 return retval; 528 return retval;
529} 529}
530 530
531static int hpc_query_power_fault(struct slot * slot) 531static int hpc_query_power_fault(struct slot *slot)
532{ 532{
533 struct controller *ctrl = slot->ctrl; 533 struct controller *ctrl = slot->ctrl;
534 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); 534 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot));
@@ -614,7 +614,7 @@ static void hpc_release_ctlr(struct controller *ctrl)
614 release_mem_region(ctrl->mmio_base, ctrl->mmio_size); 614 release_mem_region(ctrl->mmio_base, ctrl->mmio_size);
615} 615}
616 616
617static int hpc_power_on_slot(struct slot * slot) 617static int hpc_power_on_slot(struct slot *slot)
618{ 618{
619 int retval; 619 int retval;
620 620
@@ -625,7 +625,7 @@ static int hpc_power_on_slot(struct slot * slot)
625 return retval; 625 return retval;
626} 626}
627 627
628static int hpc_slot_enable(struct slot * slot) 628static int hpc_slot_enable(struct slot *slot)
629{ 629{
630 int retval; 630 int retval;
631 631
@@ -638,7 +638,7 @@ static int hpc_slot_enable(struct slot * slot)
638 return retval; 638 return retval;
639} 639}
640 640
641static int hpc_slot_disable(struct slot * slot) 641static int hpc_slot_disable(struct slot *slot)
642{ 642{
643 int retval; 643 int retval;
644 644
@@ -720,7 +720,7 @@ static int shpc_get_cur_bus_speed(struct controller *ctrl)
720} 720}
721 721
722 722
723static int hpc_set_bus_speed_mode(struct slot * slot, enum pci_bus_speed value) 723static int hpc_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value)
724{ 724{
725 int retval; 725 int retval;
726 struct controller *ctrl = slot->ctrl; 726 struct controller *ctrl = slot->ctrl;
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
index e8c31fe20566..52875b360463 100644
--- a/drivers/pci/hotplug/shpchp_sysfs.c
+++ b/drivers/pci/hotplug/shpchp_sysfs.c
@@ -38,7 +38,7 @@
38static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf) 38static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf)
39{ 39{
40 struct pci_dev *pdev; 40 struct pci_dev *pdev;
41 char * out = buf; 41 char *out = buf;
42 int index, busnr; 42 int index, busnr;
43 struct resource *res; 43 struct resource *res;
44 struct pci_bus *bus; 44 struct pci_bus *bus;