From: David Rientjes <rientjes@google.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-doc@vger.kernel.org, Rob Landley <rob@landley.net>,
Andrew Morton <akpm@linux-foundation.org>,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Jiang Liu <jiang.liu@huawei.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Minchan Kim <minchan.kim@gmail.com>, Mel Gorman <mgorman@suse.de>,
Yinghai Lu <yinghai@kernel.org>,
"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>
Subject: Re: [PART2 Patch] node: cleanup node_state_attr
Date: Wed, 31 Oct 2012 11:29:17 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1210311128570.8809@chino.kir.corp.google.com> (raw)
In-Reply-To: <1351666528-8226-2-git-send-email-wency@cn.fujitsu.com>
On Wed, 31 Oct 2012, Wen Congyang wrote:
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index af1a177..5d7731e 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -614,23 +614,23 @@ static ssize_t show_node_state(struct device *dev,
> { __ATTR(name, 0444, show_node_state, NULL), state }
>
> static struct node_attr node_state_attr[] = {
> - _NODE_ATTR(possible, N_POSSIBLE),
> - _NODE_ATTR(online, N_ONLINE),
> - _NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY),
> - _NODE_ATTR(has_cpu, N_CPU),
> + [N_POSSIBLE] = _NODE_ATTR(possible, N_POSSIBLE),
> + [N_ONLINE] = _NODE_ATTR(online, N_ONLINE),
> + [N_NORMAL_MEMORY] = _NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY),
> #ifdef CONFIG_HIGHMEM
> - _NODE_ATTR(has_high_memory, N_HIGH_MEMORY),
> + [N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY),
> #endif
> + [N_CPU] = _NODE_ATTR(has_cpu, N_CPU),
> };
>
Why change the index for N_CPU?
> static struct attribute *node_state_attrs[] = {
> - &node_state_attr[0].attr.attr,
> - &node_state_attr[1].attr.attr,
> - &node_state_attr[2].attr.attr,
> - &node_state_attr[3].attr.attr,
> + &node_state_attr[N_POSSIBLE].attr.attr,
> + &node_state_attr[N_ONLINE].attr.attr,
> + &node_state_attr[N_NORMAL_MEMORY].attr.attr,
> #ifdef CONFIG_HIGHMEM
> - &node_state_attr[4].attr.attr,
> + &node_state_attr[N_HIGH_MEMORY].attr.attr,
> #endif
> + &node_state_attr[N_CPU].attr.attr,
> NULL
> };
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-10-31 18:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 6:55 [PART2 Patch] some cleanups Wen Congyang
2012-10-31 6:55 ` [PART2 Patch] node: cleanup node_state_attr Wen Congyang
2012-10-31 18:29 ` David Rientjes [this message]
2012-11-01 5:52 ` Wen Congyang
2012-11-01 21:29 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1210311128570.8809@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=jiang.liu@huawei.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
--cc=rob@landley.net \
--cc=rusty@rustcorp.com.au \
--cc=wency@cn.fujitsu.com \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox