diff options
author | Douglas Thompson <dougthompson@xmission.com> | 2007-07-19 04:49:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:54 -0400 |
commit | 079708b9173595bf74b31b14c36e946359ae6c7e (patch) | |
tree | 79ed508a2ccdcf8d8095923cb4613594ed0af54d /drivers/edac/edac_pci.c | |
parent | 4de78c6877ec21142582ac19453c2d453d1ea298 (diff) |
drivers/edac: core Lindent cleanup
Run the EDAC CORE files through Lindent for cleanup
Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_pci.c')
-rw-r--r-- | drivers/edac/edac_pci.c | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 9f4aaaaa4ed7..abefd96680d7 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -46,9 +46,8 @@ static inline void edac_unlock_pci_list(void) | |||
46 | * structure. The chip driver will allocate one of these for each | 46 | * structure. The chip driver will allocate one of these for each |
47 | * edac_pci it is going to control/register with the EDAC CORE. | 47 | * edac_pci it is going to control/register with the EDAC CORE. |
48 | */ | 48 | */ |
49 | struct edac_pci_ctl_info * edac_pci_alloc_ctl_info( | 49 | struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, |
50 | unsigned int sz_pvt, | 50 | const char *edac_pci_name) |
51 | const char *edac_pci_name) | ||
52 | { | 51 | { |
53 | struct edac_pci_ctl_info *pci; | 52 | struct edac_pci_ctl_info *pci; |
54 | void *pvt; | 53 | void *pvt; |
@@ -67,10 +66,11 @@ struct edac_pci_ctl_info * edac_pci_alloc_ctl_info( | |||
67 | 66 | ||
68 | pci->op_state = OP_ALLOC; | 67 | pci->op_state = OP_ALLOC; |
69 | 68 | ||
70 | snprintf(pci->name, strlen(edac_pci_name)+1, "%s", edac_pci_name); | 69 | snprintf(pci->name, strlen(edac_pci_name) + 1, "%s", edac_pci_name); |
71 | 70 | ||
72 | return pci; | 71 | return pci; |
73 | } | 72 | } |
73 | |||
74 | EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); | 74 | EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); |
75 | 75 | ||
76 | /* | 76 | /* |
@@ -81,13 +81,14 @@ void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci) | |||
81 | { | 81 | { |
82 | kfree(pci); | 82 | kfree(pci); |
83 | } | 83 | } |
84 | |||
84 | EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info); | 85 | EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info); |
85 | 86 | ||
86 | /* | 87 | /* |
87 | * find_edac_pci_by_dev() | 88 | * find_edac_pci_by_dev() |
88 | * scans the edac_pci list for a specific 'struct device *' | 89 | * scans the edac_pci list for a specific 'struct device *' |
89 | */ | 90 | */ |
90 | static struct edac_pci_ctl_info * find_edac_pci_by_dev(struct device *dev) | 91 | static struct edac_pci_ctl_info *find_edac_pci_by_dev(struct device *dev) |
91 | { | 92 | { |
92 | struct edac_pci_ctl_info *pci; | 93 | struct edac_pci_ctl_info *pci; |
93 | struct list_head *item; | 94 | struct list_head *item; |
@@ -139,17 +140,18 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci) | |||
139 | list_add_tail_rcu(&pci->link, insert_before); | 140 | list_add_tail_rcu(&pci->link, insert_before); |
140 | return 0; | 141 | return 0; |
141 | 142 | ||
142 | fail0: | 143 | fail0: |
143 | edac_printk(KERN_WARNING, EDAC_PCI, | 144 | edac_printk(KERN_WARNING, EDAC_PCI, |
144 | "%s (%s) %s %s already assigned %d\n", | 145 | "%s (%s) %s %s already assigned %d\n", |
145 | rover->dev->bus_id, dev_name(rover), | 146 | rover->dev->bus_id, dev_name(rover), |
146 | rover->mod_name, rover->ctl_name, rover->pci_idx); | 147 | rover->mod_name, rover->ctl_name, rover->pci_idx); |
147 | return 1; | 148 | return 1; |
148 | 149 | ||
149 | fail1: | 150 | fail1: |
150 | edac_printk(KERN_WARNING, EDAC_PCI, | 151 | edac_printk(KERN_WARNING, EDAC_PCI, |
151 | "but in low-level driver: attempt to assign\n" | 152 | "but in low-level driver: attempt to assign\n" |
152 | "\tduplicate pci_idx %d in %s()\n", rover->pci_idx, __func__); | 153 | "\tduplicate pci_idx %d in %s()\n", rover->pci_idx, |
154 | __func__); | ||
153 | return 1; | 155 | return 1; |
154 | } | 156 | } |
155 | 157 | ||
@@ -185,7 +187,7 @@ static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci) | |||
185 | * | 187 | * |
186 | * Caller must hold pci_ctls_mutex. | 188 | * Caller must hold pci_ctls_mutex. |
187 | */ | 189 | */ |
188 | struct edac_pci_ctl_info * edac_pci_find(int idx) | 190 | struct edac_pci_ctl_info *edac_pci_find(int idx) |
189 | { | 191 | { |
190 | struct list_head *item; | 192 | struct list_head *item; |
191 | struct edac_pci_ctl_info *pci; | 193 | struct edac_pci_ctl_info *pci; |
@@ -198,13 +200,14 @@ struct edac_pci_ctl_info * edac_pci_find(int idx) | |||
198 | if (pci->pci_idx == idx) | 200 | if (pci->pci_idx == idx) |
199 | return pci; | 201 | return pci; |
200 | 202 | ||
201 | /* not on list, so terminate early */ | 203 | /* not on list, so terminate early */ |
202 | break; | 204 | break; |
203 | } | 205 | } |
204 | } | 206 | } |
205 | 207 | ||
206 | return NULL; | 208 | return NULL; |
207 | } | 209 | } |
210 | |||
208 | EXPORT_SYMBOL_GPL(edac_pci_find); | 211 | EXPORT_SYMBOL_GPL(edac_pci_find); |
209 | 212 | ||
210 | /* | 213 | /* |
@@ -225,15 +228,14 @@ static void edac_pci_workq_function(void *ptr) | |||
225 | edac_lock_pci_list(); | 228 | edac_lock_pci_list(); |
226 | 229 | ||
227 | if ((pci->op_state == OP_RUNNING_POLL) && | 230 | if ((pci->op_state == OP_RUNNING_POLL) && |
228 | (pci->edac_check != NULL) && | 231 | (pci->edac_check != NULL) && (edac_pci_get_check_errors())) |
229 | (edac_pci_get_check_errors())) | ||
230 | pci->edac_check(pci); | 232 | pci->edac_check(pci); |
231 | 233 | ||
232 | edac_unlock_pci_list(); | 234 | edac_unlock_pci_list(); |
233 | 235 | ||
234 | /* Reschedule */ | 236 | /* Reschedule */ |
235 | queue_delayed_work(edac_workqueue, &pci->work, | 237 | queue_delayed_work(edac_workqueue, &pci->work, |
236 | msecs_to_jiffies(edac_pci_get_poll_msec())); | 238 | msecs_to_jiffies(edac_pci_get_poll_msec())); |
237 | } | 239 | } |
238 | 240 | ||
239 | /* | 241 | /* |
@@ -242,7 +244,7 @@ static void edac_pci_workq_function(void *ptr) | |||
242 | * passing in the new delay period in msec | 244 | * passing in the new delay period in msec |
243 | */ | 245 | */ |
244 | static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, | 246 | static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, |
245 | unsigned int msec) | 247 | unsigned int msec) |
246 | { | 248 | { |
247 | debugf0("%s()\n", __func__); | 249 | debugf0("%s()\n", __func__); |
248 | 250 | ||
@@ -252,7 +254,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, | |||
252 | INIT_WORK(&pci->work, edac_pci_workq_function, pci); | 254 | INIT_WORK(&pci->work, edac_pci_workq_function, pci); |
253 | #endif | 255 | #endif |
254 | queue_delayed_work(edac_workqueue, &pci->work, | 256 | queue_delayed_work(edac_workqueue, &pci->work, |
255 | msecs_to_jiffies(edac_pci_get_poll_msec())); | 257 | msecs_to_jiffies(edac_pci_get_poll_msec())); |
256 | } | 258 | } |
257 | 259 | ||
258 | /* | 260 | /* |
@@ -272,7 +274,7 @@ static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci) | |||
272 | * edac_pci_reset_delay_period | 274 | * edac_pci_reset_delay_period |
273 | */ | 275 | */ |
274 | void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, | 276 | void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, |
275 | unsigned long value) | 277 | unsigned long value) |
276 | { | 278 | { |
277 | edac_lock_pci_list(); | 279 | edac_lock_pci_list(); |
278 | 280 | ||
@@ -282,6 +284,7 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, | |||
282 | 284 | ||
283 | edac_unlock_pci_list(); | 285 | edac_unlock_pci_list(); |
284 | } | 286 | } |
287 | |||
285 | EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); | 288 | EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); |
286 | 289 | ||
287 | /* | 290 | /* |
@@ -324,22 +327,22 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx) | |||
324 | } | 327 | } |
325 | 328 | ||
326 | edac_pci_printk(pci, KERN_INFO, | 329 | edac_pci_printk(pci, KERN_INFO, |
327 | "Giving out device to module '%s' controller '%s':" | 330 | "Giving out device to module '%s' controller '%s':" |
328 | " DEV '%s' (%s)\n", | 331 | " DEV '%s' (%s)\n", |
329 | pci->mod_name, | 332 | pci->mod_name, |
330 | pci->ctl_name, | 333 | pci->ctl_name, |
331 | dev_name(pci), | 334 | dev_name(pci), edac_op_state_toString(pci->op_state)); |
332 | edac_op_state_toString(pci->op_state)); | ||
333 | 335 | ||
334 | edac_unlock_pci_list(); | 336 | edac_unlock_pci_list(); |
335 | return 0; | 337 | return 0; |
336 | 338 | ||
337 | fail1: | 339 | fail1: |
338 | del_edac_pci_from_global_list(pci); | 340 | del_edac_pci_from_global_list(pci); |
339 | fail0: | 341 | fail0: |
340 | edac_unlock_pci_list(); | 342 | edac_unlock_pci_list(); |
341 | return 1; | 343 | return 1; |
342 | } | 344 | } |
345 | |||
343 | EXPORT_SYMBOL_GPL(edac_pci_add_device); | 346 | EXPORT_SYMBOL_GPL(edac_pci_add_device); |
344 | 347 | ||
345 | /* | 348 | /* |
@@ -355,7 +358,7 @@ EXPORT_SYMBOL_GPL(edac_pci_add_device); | |||
355 | * Pointer to removed edac_pci structure, | 358 | * Pointer to removed edac_pci structure, |
356 | * or NULL if device not found | 359 | * or NULL if device not found |
357 | */ | 360 | */ |
358 | struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev) | 361 | struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev) |
359 | { | 362 | { |
360 | struct edac_pci_ctl_info *pci; | 363 | struct edac_pci_ctl_info *pci; |
361 | 364 | ||
@@ -379,14 +382,12 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev) | |||
379 | edac_unlock_pci_list(); | 382 | edac_unlock_pci_list(); |
380 | 383 | ||
381 | edac_printk(KERN_INFO, EDAC_PCI, | 384 | edac_printk(KERN_INFO, EDAC_PCI, |
382 | "Removed device %d for %s %s: DEV %s\n", | 385 | "Removed device %d for %s %s: DEV %s\n", |
383 | pci->pci_idx, | 386 | pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci)); |
384 | pci->mod_name, | ||
385 | pci->ctl_name, | ||
386 | dev_name(pci)); | ||
387 | 387 | ||
388 | return pci; | 388 | return pci; |
389 | } | 389 | } |
390 | |||
390 | EXPORT_SYMBOL_GPL(edac_pci_del_device); | 391 | EXPORT_SYMBOL_GPL(edac_pci_del_device); |
391 | 392 | ||
392 | void edac_pci_generic_check(struct edac_pci_ctl_info *pci) | 393 | void edac_pci_generic_check(struct edac_pci_ctl_info *pci) |
@@ -401,8 +402,8 @@ struct edac_pci_gen_data { | |||
401 | int edac_idx; | 402 | int edac_idx; |
402 | }; | 403 | }; |
403 | 404 | ||
404 | struct edac_pci_ctl_info * | 405 | struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, |
405 | edac_pci_create_generic_ctl(struct device *dev, const char *mod_name) | 406 | const char *mod_name) |
406 | { | 407 | { |
407 | struct edac_pci_ctl_info *pci; | 408 | struct edac_pci_ctl_info *pci; |
408 | struct edac_pci_gen_data *pdata; | 409 | struct edac_pci_gen_data *pdata; |
@@ -430,6 +431,7 @@ edac_pci_create_generic_ctl(struct device *dev, const char *mod_name) | |||
430 | 431 | ||
431 | return pci; | 432 | return pci; |
432 | } | 433 | } |
434 | |||
433 | EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl); | 435 | EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl); |
434 | 436 | ||
435 | void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) | 437 | void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) |
@@ -437,4 +439,5 @@ void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) | |||
437 | edac_pci_del_device(pci->dev); | 439 | edac_pci_del_device(pci->dev); |
438 | edac_pci_free_ctl_info(pci); | 440 | edac_pci_free_ctl_info(pci); |
439 | } | 441 | } |
442 | |||
440 | EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl); | 443 | EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl); |