Re: [PATCH] Register sysfs file for hotpluged new node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Tue, 2006-05-16 at 21:23 +0900, Yasunori Goto wrote:
> > +int arch_register_node(int num){
> > +       int p_node;
> > +       struct node *parent = NULL;
> > +
> > +       if (!node_online(num))
> > +               return 0;
> > +       p_node = parent_node(num);
> > +
> > +       if (p_node != num)
> > +               parent = &node_devices[p_node].node;
> > +
> > +       return register_node(&node_devices[num].node, num, parent);
> > +}
> > +
> > +void arch_unregister_node(int num)
> > +{
> > +       unregister_node(&node_devices[num].node);
> > +}
> ...
> > +int arch_register_node(int i)
> > +{
> > +       int error = 0;
> > +
> > +       if (node_online(i)){
> > +               int p_node = parent_node(i);
> > +               struct node *parent = NULL;
> > +
> > +               if (p_node != i)
> > +                       parent = &node_devices[p_node];
> > +               error = register_node(&node_devices[i], i, parent);
> > +       }
> > +
> > +       return error;
> > +} 
> 
> While you're at it, can you consolidate these two functions?  I don't
> see too much of a reason for keeping them separate.  You can probably
> also kill the 'struct i386_node' since it is just a 'struct node'
> wrapper anyway.  

Hmmmmmmmm.
I've worried that it can or can't be done. These codes look like midway of
registering hierarchies, because all of arch's parent_node() is just
parent_node(nid) = nid. I guess someone would like to make real code at
here. But, these might be just wrecks too. :-(

Ok. I'll try consolidate once. If there is a person who would like to
make something at here, he will complain. :-P

> I promise not to complain if you fix the i386 function's braces, too. ;)

Oops. Indeed.

-- 
Yasunori Goto 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux