Re: [PATCH] cputopology: Always define CPU topology information [4th try]

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Wednesday, June 4, 2008 - 9:47 pm

On Wed, 4 Jun 2008 16:44:56 +0100 Ben Hutchings <bhutchings@solarflare.com> wrote:


See, this is what I meant.  After your patch we have:

#ifdef arch_provides_topology_pointers
#define define_siblings_show_map(name)					\
static ssize_t show_##name(struct sys_device *dev, char *buf)	\
{									\
	unsigned int cpu = dev->id;					\
	cpumask_t siblings = topology_##name(cpu);			\
	return show_cpumap(0, &siblings, buf);				\
}

#define define_siblings_show_list(name)					\
static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
{									\
	unsigned int cpu = dev->id;					\
	cpumask_t siblings = topology_##name(cpu);			\
	return show_cpumap(1, &siblings, buf);				\
}

#else
#define define_siblings_show_map(name)					\
static ssize_t show_##name(struct sys_device *dev, char *buf)	\
{									\
	unsigned int cpu = dev->id;					\
	cpumask_t mask = topology_##name(cpu);				\
	return show_cpumap(0, &mask, buf);				\
}

#define define_siblings_show_list(name)					\
static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
{									\
	unsigned int cpu = dev->id;					\
	cpumask_t mask = topology_##name(cpu);				\
	return show_cpumap(1, &mask, buf);				\
}
#endif

they're the same!
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] cputopology: Always define CPU topology inform ..., Andrew Morton, (Wed Jun 4, 9:47 pm)