From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 29 Aug 2007 15:14:58 -0700 (PDT) From: Christoph Lameter Subject: Re: [PATCH/RFC] Add node states sysfs class attributeS - V3 In-Reply-To: <1188423105.5121.47.camel@localhost> Message-ID: References: <200708242228.l7OMS5fU017948@imap1.linux-foundation.org> <20070827181405.57a3d8fe.akpm@linux-foundation.org> <20070827201822.2506b888.akpm@linux-foundation.org> <20070827222912.8b364352.akpm@linux-foundation.org> <20070827231214.99e3c33f.akpm@linux-foundation.org> <1188309928.5079.37.camel@localhost> <29495f1d0708281513g406af15an8139df5fae20ad35@mail.gmail.com> <1188398621.5121.13.camel@localhost> <1188423105.5121.47.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Lee Schermerhorn Cc: linux-mm , Nish Aravamudan , Andrew Morton , mel@skynet.ie, y-goto@jp.fujitsu.com, Kamezawa Hiroyuki , Eric Whitney List-ID: On Wed, 29 Aug 2007, Lee Schermerhorn wrote: > root@gwydyr(root):cat /sys/devices/system/node/possible > possible: 0-255 The file is already called "possible". Repeating it in the output will make it difficult to parse. > +static ssize_t > +print_nodes_possible(struct sysdev_class *class, char *buf) > +{ > + return print_nodes_state(N_POSSIBLE, buf); > +} > + > +static ssize_t > +print_nodes_online(struct sysdev_class *class, char *buf) > +{ > + return print_nodes_state(N_ONLINE, buf); > +} > + > +static ssize_t > +print_nodes_has_normal_memory(struct sysdev_class *class, char *buf) > +{ > + return print_nodes_state(N_NORMAL_MEMORY, buf); > +} > + > +static ssize_t > +print_nodes_has_cpu(struct sysdev_class *class, char *buf) > +{ > + return print_nodes_state(N_CPU, buf); > +} Is there a way to avoid having to add another one of these if we add a new node state? Also there is a CR after the type. -- 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: email@kvack.org