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

From: Dave Hansen
Date: Tue May 16 2006 - 12:52:00 EST


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.

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

-- Dave

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