diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/cpu.h | 18 | ||||
| -rw-r--r-- | include/asm-i386/memblk.h | 7 | ||||
| -rw-r--r-- | include/asm-i386/node.h | 11 | ||||
| -rw-r--r-- | include/linux/cpu.h | 2 | ||||
| -rw-r--r-- | include/linux/memblk.h | 2 | ||||
| -rw-r--r-- | include/linux/node.h | 2 |
6 files changed, 18 insertions, 24 deletions
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h index a468558193f8..50b1d4439a44 100644 --- a/include/asm-i386/cpu.h +++ b/include/asm-i386/cpu.h @@ -13,18 +13,14 @@ struct i386_cpu { extern struct i386_cpu cpu_devices[NR_CPUS]; -#ifdef CONFIG_NUMA -static inline void arch_register_cpu(int num){ - int p_node = __cpu_to_node(num); +static inline int arch_register_cpu(int num){ + struct node *parent = NULL; - if (p_node >= 0 && p_node < NR_CPUS) - register_cpu(&cpu_devices[num].cpu, num, - &node_devices[p_node].node); -} -#else /* !CONFIG_NUMA */ -static inline void arch_register_cpu(int num){ - register_cpu(&cpu_devices[num].cpu, num, (struct node *) NULL); -} +#ifdef CONFIG_NUMA + parent = &node_devices[__cpu_to_node(num)].node; #endif /* CONFIG_NUMA */ + return register_cpu(&cpu_devices[num].cpu, num, parent); +} + #endif /* _ASM_I386_CPU_H_ */ diff --git a/include/asm-i386/memblk.h b/include/asm-i386/memblk.h index 312816848ee3..a3a23052a93a 100644 --- a/include/asm-i386/memblk.h +++ b/include/asm-i386/memblk.h @@ -13,12 +13,11 @@ struct i386_memblk { }; extern struct i386_memblk memblk_devices[MAX_NR_MEMBLKS]; -static inline void arch_register_memblk(int num){ +static inline int arch_register_memblk(int num){ int p_node = __memblk_to_node(num); - if (p_node >= 0 && p_node < MAX_NR_MEMBLKS) - register_memblk(&memblk_devices[num].memblk, num, - &node_devices[p_node].node); + return register_memblk(&memblk_devices[num].memblk, num, + &node_devices[p_node].node); } #endif /* _ASM_I386_MEMBLK_H_ */ diff --git a/include/asm-i386/node.h b/include/asm-i386/node.h index 0f73d9047886..26836eb7be10 100644 --- a/include/asm-i386/node.h +++ b/include/asm-i386/node.h @@ -12,15 +12,14 @@ struct i386_node { }; extern struct i386_node node_devices[MAX_NUMNODES]; -static inline void arch_register_node(int num){ +static inline int arch_register_node(int num){ int p_node = __parent_node(num); + struct node *parent = NULL; if (p_node != num) - register_node(&node_devices[num].node, num, - &node_devices[p_node].node); - else - register_node(&node_devices[num].node, num, - (struct node *) NULL); + parent = &node_devices[p_node].node; + + return register_node(&node_devices[num].node, num, parent); } #endif /* _ASM_I386_NODE_H_ */ diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 7fab9f205d8f..4cbab1066761 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -27,6 +27,6 @@ struct cpu { struct sys_device sysdev; }; -extern void register_cpu(struct cpu *, int, struct node *); +extern int register_cpu(struct cpu *, int, struct node *); #endif /* _LINUX_CPU_H_ */ diff --git a/include/linux/memblk.h b/include/linux/memblk.h index a7dab1103ebe..5f216fb47907 100644 --- a/include/linux/memblk.h +++ b/include/linux/memblk.h @@ -27,6 +27,6 @@ struct memblk { struct sys_device sysdev; }; -extern void register_memblk(struct memblk *, int, struct node *); +extern int register_memblk(struct memblk *, int, struct node *); #endif /* _LINUX_MEMBLK_H_ */ diff --git a/include/linux/node.h b/include/linux/node.h index a416b3cab960..294606bbff5a 100644 --- a/include/linux/node.h +++ b/include/linux/node.h @@ -26,7 +26,7 @@ struct node { struct sys_root sysroot; }; -extern void register_node(struct node *, int, struct node *); +extern int register_node(struct node *, int, struct node *); #define to_node(_root) container_of(_root, struct node, sysroot) #define to_root(_dev) container_of(_dev, struct sys_root, dev) |
