aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_device_sysfs.c
diff options
context:
space:
mode:
authorDouglas Thompson <dougthompson@xmission.com>2007-07-19 04:50:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:55 -0400
commit052dfb45ccb5ea354a426b52556bcfee75b9d2f5 (patch)
tree3f85586625b25f7eaf0471c99fc296bdd4ada4eb /drivers/edac/edac_device_sysfs.c
parent6bc7840411b8c7fe11e1879d882c88119d1c033e (diff)
drivers/edac: cleanup spaces-gotos after Lindent messup
This patch fixes some remnant spaces inserted by the use of Lindent. Seems Lindent adds some spaces when it shoulded. These have been fixed. In addition, goto targets have issues, these have been fixed in this patch. Signed-off-by: Douglas Thompson <dougthompson@xmission.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_device_sysfs.c')
-rw-r--r--drivers/edac/edac_device_sysfs.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 32b2a8e53dc7..5bf7cbab27d4 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -27,14 +27,14 @@
27 27
28/* 'log_ue' */ 28/* 'log_ue' */
29static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info 29static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info
30 *ctl_info, char *data) 30 *ctl_info, char *data)
31{ 31{
32 return sprintf(data, "%u\n", ctl_info->log_ue); 32 return sprintf(data, "%u\n", ctl_info->log_ue);
33} 33}
34 34
35static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info 35static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
36 *ctl_info, const char *data, 36 *ctl_info, const char *data,
37 size_t count) 37 size_t count)
38{ 38{
39 /* if parameter is zero, turn off flag, if non-zero turn on flag */ 39 /* if parameter is zero, turn off flag, if non-zero turn on flag */
40 ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0); 40 ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
@@ -44,14 +44,14 @@ static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
44 44
45/* 'log_ce' */ 45/* 'log_ce' */
46static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info 46static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info
47 *ctl_info, char *data) 47 *ctl_info, char *data)
48{ 48{
49 return sprintf(data, "%u\n", ctl_info->log_ce); 49 return sprintf(data, "%u\n", ctl_info->log_ce);
50} 50}
51 51
52static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info 52static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info
53 *ctl_info, const char *data, 53 *ctl_info, const char *data,
54 size_t count) 54 size_t count)
55{ 55{
56 /* if parameter is zero, turn off flag, if non-zero turn on flag */ 56 /* if parameter is zero, turn off flag, if non-zero turn on flag */
57 ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0); 57 ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
@@ -78,14 +78,14 @@ static ssize_t edac_device_ctl_panic_on_ue_store(struct edac_device_ctl_info
78 78
79/* 'poll_msec' show and store functions*/ 79/* 'poll_msec' show and store functions*/
80static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info 80static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info
81 *ctl_info, char *data) 81 *ctl_info, char *data)
82{ 82{
83 return sprintf(data, "%u\n", ctl_info->poll_msec); 83 return sprintf(data, "%u\n", ctl_info->poll_msec);
84} 84}
85 85
86static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info 86static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info
87 *ctl_info, const char *data, 87 *ctl_info, const char *data,
88 size_t count) 88 size_t count)
89{ 89{
90 unsigned long value; 90 unsigned long value;
91 91
@@ -112,7 +112,7 @@ struct ctl_info_attribute {
112 112
113/* Function to 'show' fields from the edac_dev 'ctl_info' structure */ 113/* Function to 'show' fields from the edac_dev 'ctl_info' structure */
114static ssize_t edac_dev_ctl_info_show(struct kobject *kobj, 114static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
115 struct attribute *attr, char *buffer) 115 struct attribute *attr, char *buffer)
116{ 116{
117 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); 117 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
118 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr); 118 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
@@ -124,8 +124,8 @@ static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
124 124
125/* Function to 'store' fields into the edac_dev 'ctl_info' structure */ 125/* Function to 'store' fields into the edac_dev 'ctl_info' structure */
126static ssize_t edac_dev_ctl_info_store(struct kobject *kobj, 126static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
127 struct attribute *attr, 127 struct attribute *attr,
128 const char *buffer, size_t count) 128 const char *buffer, size_t count)
129{ 129{
130 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); 130 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
131 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr); 131 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
@@ -143,21 +143,21 @@ static struct sysfs_ops device_ctl_info_ops = {
143 143
144#define CTL_INFO_ATTR(_name,_mode,_show,_store) \ 144#define CTL_INFO_ATTR(_name,_mode,_show,_store) \
145static struct ctl_info_attribute attr_ctl_info_##_name = { \ 145static struct ctl_info_attribute attr_ctl_info_##_name = { \
146 .attr = {.name = __stringify(_name), .mode = _mode }, \ 146 .attr = {.name = __stringify(_name), .mode = _mode }, \
147 .show = _show, \ 147 .show = _show, \
148 .store = _store, \ 148 .store = _store, \
149}; 149};
150 150
151/* Declare the various ctl_info attributes here and their respective ops */ 151/* Declare the various ctl_info attributes here and their respective ops */
152CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR, 152CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR,
153 edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store); 153 edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store);
154CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR, 154CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR,
155 edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store); 155 edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store);
156CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR, 156CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR,
157 edac_device_ctl_panic_on_ue_show, 157 edac_device_ctl_panic_on_ue_show,
158 edac_device_ctl_panic_on_ue_store); 158 edac_device_ctl_panic_on_ue_store);
159CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR, 159CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR,
160 edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store); 160 edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store);
161 161
162/* Base Attributes of the EDAC_DEVICE ECC object */ 162/* Base Attributes of the EDAC_DEVICE ECC object */
163static struct ctl_info_attribute *device_ctrl_attr[] = { 163static struct ctl_info_attribute *device_ctrl_attr[] = {
@@ -242,7 +242,7 @@ static int edac_device_register_main_kobj(struct edac_device_ctl_info *edac_dev)
242 * the '..../edac/<name>' kobject 242 * the '..../edac/<name>' kobject
243 */ 243 */
244static void edac_device_unregister_main_kobj(struct edac_device_ctl_info 244static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
245 *edac_dev) 245 *edac_dev)
246{ 246{
247 debugf0("%s()\n", __func__); 247 debugf0("%s()\n", __func__);
248 debugf1("%s() name of kobject is: %s\n", 248 debugf1("%s() name of kobject is: %s\n",
@@ -264,13 +264,13 @@ static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
264 * Set of low-level instance attribute show functions 264 * Set of low-level instance attribute show functions
265 */ 265 */
266static ssize_t instance_ue_count_show(struct edac_device_instance *instance, 266static ssize_t instance_ue_count_show(struct edac_device_instance *instance,
267 char *data) 267 char *data)
268{ 268{
269 return sprintf(data, "%u\n", instance->counters.ue_count); 269 return sprintf(data, "%u\n", instance->counters.ue_count);
270} 270}
271 271
272static ssize_t instance_ce_count_show(struct edac_device_instance *instance, 272static ssize_t instance_ce_count_show(struct edac_device_instance *instance,
273 char *data) 273 char *data)
274{ 274{
275 return sprintf(data, "%u\n", instance->counters.ce_count); 275 return sprintf(data, "%u\n", instance->counters.ce_count);
276} 276}
@@ -298,7 +298,7 @@ struct instance_attribute {
298 298
299/* Function to 'show' fields from the edac_dev 'instance' structure */ 299/* Function to 'show' fields from the edac_dev 'instance' structure */
300static ssize_t edac_dev_instance_show(struct kobject *kobj, 300static ssize_t edac_dev_instance_show(struct kobject *kobj,
301 struct attribute *attr, char *buffer) 301 struct attribute *attr, char *buffer)
302{ 302{
303 struct edac_device_instance *instance = to_instance(kobj); 303 struct edac_device_instance *instance = to_instance(kobj);
304 struct instance_attribute *instance_attr = to_instance_attr(attr); 304 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -310,8 +310,8 @@ static ssize_t edac_dev_instance_show(struct kobject *kobj,
310 310
311/* Function to 'store' fields into the edac_dev 'instance' structure */ 311/* Function to 'store' fields into the edac_dev 'instance' structure */
312static ssize_t edac_dev_instance_store(struct kobject *kobj, 312static ssize_t edac_dev_instance_store(struct kobject *kobj,
313 struct attribute *attr, 313 struct attribute *attr,
314 const char *buffer, size_t count) 314 const char *buffer, size_t count)
315{ 315{
316 struct edac_device_instance *instance = to_instance(kobj); 316 struct edac_device_instance *instance = to_instance(kobj);
317 struct instance_attribute *instance_attr = to_instance_attr(attr); 317 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -329,9 +329,9 @@ static struct sysfs_ops device_instance_ops = {
329 329
330#define INSTANCE_ATTR(_name,_mode,_show,_store) \ 330#define INSTANCE_ATTR(_name,_mode,_show,_store) \
331static struct instance_attribute attr_instance_##_name = { \ 331static struct instance_attribute attr_instance_##_name = { \
332 .attr = {.name = __stringify(_name), .mode = _mode }, \ 332 .attr = {.name = __stringify(_name), .mode = _mode }, \
333 .show = _show, \ 333 .show = _show, \
334 .store = _store, \ 334 .store = _store, \
335}; 335};
336 336
337/* 337/*
@@ -394,7 +394,7 @@ struct block_attribute {
394 394
395/* Function to 'show' fields from the edac_dev 'block' structure */ 395/* Function to 'show' fields from the edac_dev 'block' structure */
396static ssize_t edac_dev_block_show(struct kobject *kobj, 396static ssize_t edac_dev_block_show(struct kobject *kobj,
397 struct attribute *attr, char *buffer) 397 struct attribute *attr, char *buffer)
398{ 398{
399 struct edac_device_block *block = to_block(kobj); 399 struct edac_device_block *block = to_block(kobj);
400 struct block_attribute *block_attr = to_block_attr(attr); 400 struct block_attribute *block_attr = to_block_attr(attr);
@@ -406,8 +406,8 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
406 406
407/* Function to 'store' fields into the edac_dev 'block' structure */ 407/* Function to 'store' fields into the edac_dev 'block' structure */
408static ssize_t edac_dev_block_store(struct kobject *kobj, 408static ssize_t edac_dev_block_store(struct kobject *kobj,
409 struct attribute *attr, 409 struct attribute *attr,
410 const char *buffer, size_t count) 410 const char *buffer, size_t count)
411{ 411{
412 struct edac_device_block *block = to_block(kobj); 412 struct edac_device_block *block = to_block(kobj);
413 struct block_attribute *block_attr = to_block_attr(attr); 413 struct block_attribute *block_attr = to_block_attr(attr);
@@ -425,9 +425,9 @@ static struct sysfs_ops device_block_ops = {
425 425
426#define BLOCK_ATTR(_name,_mode,_show,_store) \ 426#define BLOCK_ATTR(_name,_mode,_show,_store) \
427static struct block_attribute attr_block_##_name = { \ 427static struct block_attribute attr_block_##_name = { \
428 .attr = {.name = __stringify(_name), .mode = _mode }, \ 428 .attr = {.name = __stringify(_name), .mode = _mode }, \
429 .show = _show, \ 429 .show = _show, \
430 .store = _store, \ 430 .store = _store, \
431}; 431};
432 432
433BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL); 433BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
@@ -453,8 +453,8 @@ static struct kobj_type ktype_block_ctrl = {
453 * edac_device_create_block 453 * edac_device_create_block
454 */ 454 */
455static int edac_device_create_block(struct edac_device_ctl_info *edac_dev, 455static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
456 struct edac_device_instance *instance, 456 struct edac_device_instance *instance,
457 int idx) 457 int idx)
458{ 458{
459 int err; 459 int err;
460 struct edac_device_block *block; 460 struct edac_device_block *block;
@@ -487,8 +487,8 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
487 * edac_device_delete_block(edac_dev,j); 487 * edac_device_delete_block(edac_dev,j);
488 */ 488 */
489static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev, 489static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
490 struct edac_device_instance *instance, 490 struct edac_device_instance *instance,
491 int idx) 491 int idx)
492{ 492{
493 struct edac_device_block *block; 493 struct edac_device_block *block;
494 494
@@ -507,7 +507,7 @@ static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
507 * create just one instance of an edac_device 'instance' 507 * create just one instance of an edac_device 'instance'
508 */ 508 */
509static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev, 509static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
510 int idx) 510 int idx)
511{ 511{
512 int i, j; 512 int i, j;
513 int err; 513 int err;
@@ -627,22 +627,22 @@ static int edac_device_add_sysfs_attributes(
627 struct edac_device_ctl_info *edac_dev) 627 struct edac_device_ctl_info *edac_dev)
628{ 628{
629 int err; 629 int err;
630 struct edac_dev_sysfs_attribute *sysfs_attrib; 630 struct edac_dev_sysfs_attribute *sysfs_attrib;
631 631
632 /* point to the start of the array and iterate over it 632 /* point to the start of the array and iterate over it
633 * adding each attribute listed to this mci instance's kobject 633 * adding each attribute listed to this mci instance's kobject
634 */ 634 */
635 sysfs_attrib = edac_dev->sysfs_attributes; 635 sysfs_attrib = edac_dev->sysfs_attributes;
636 636
637 while (sysfs_attrib->attr.name != NULL) { 637 while (sysfs_attrib->attr.name != NULL) {
638 err = sysfs_create_file(&edac_dev->kobj, 638 err = sysfs_create_file(&edac_dev->kobj,
639 (struct attribute*) sysfs_attrib); 639 (struct attribute*) sysfs_attrib);
640 if (err) { 640 if (err) {
641 return err; 641 return err;
642 } 642 }
643 643
644 sysfs_attrib++; 644 sysfs_attrib++;
645 } 645 }
646 646
647 return 0; 647 return 0;
648} 648}