diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2012-12-11 19:03:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 20:22:28 -0500 |
commit | fcf07d22f089856631b52a75c35ba3c33b70a1b4 (patch) | |
tree | f826fde071ac174764e12e95d903e2e0bd98734f /drivers/base | |
parent | 81df9bff2609f07cef4690ac2ebda1611b55b05a (diff) |
drivers/base/node.c: cleanup node_state_attr[]
use [index] = init_value
use N_xxxxx instead of hardcode.
Make it more readability and easier to add new state.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/node.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index fffed4c96bb3..294e31626210 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -638,23 +638,23 @@ static ssize_t show_node_state(struct device *dev, | |||
638 | { __ATTR(name, 0444, show_node_state, NULL), state } | 638 | { __ATTR(name, 0444, show_node_state, NULL), state } |
639 | 639 | ||
640 | static struct node_attr node_state_attr[] = { | 640 | static struct node_attr node_state_attr[] = { |
641 | _NODE_ATTR(possible, N_POSSIBLE), | 641 | [N_POSSIBLE] = _NODE_ATTR(possible, N_POSSIBLE), |
642 | _NODE_ATTR(online, N_ONLINE), | 642 | [N_ONLINE] = _NODE_ATTR(online, N_ONLINE), |
643 | _NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY), | 643 | [N_NORMAL_MEMORY] = _NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY), |
644 | _NODE_ATTR(has_cpu, N_CPU), | ||
645 | #ifdef CONFIG_HIGHMEM | 644 | #ifdef CONFIG_HIGHMEM |
646 | _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), | 645 | [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY), |
647 | #endif | 646 | #endif |
647 | [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), | ||
648 | }; | 648 | }; |
649 | 649 | ||
650 | static struct attribute *node_state_attrs[] = { | 650 | static struct attribute *node_state_attrs[] = { |
651 | &node_state_attr[0].attr.attr, | 651 | &node_state_attr[N_POSSIBLE].attr.attr, |
652 | &node_state_attr[1].attr.attr, | 652 | &node_state_attr[N_ONLINE].attr.attr, |
653 | &node_state_attr[2].attr.attr, | 653 | &node_state_attr[N_NORMAL_MEMORY].attr.attr, |
654 | &node_state_attr[3].attr.attr, | ||
655 | #ifdef CONFIG_HIGHMEM | 654 | #ifdef CONFIG_HIGHMEM |
656 | &node_state_attr[4].attr.attr, | 655 | &node_state_attr[N_HIGH_MEMORY].attr.attr, |
657 | #endif | 656 | #endif |
657 | &node_state_attr[N_CPU].attr.attr, | ||
658 | NULL | 658 | NULL |
659 | }; | 659 | }; |
660 | 660 | ||