Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / base / topology.c
index 1efe162..199cd97 100644 (file)
@@ -34,7 +34,8 @@
 static SYSDEV_ATTR(_name, 0444, show_##_name, NULL)
 
 #define define_id_show_func(name)                              \
-static ssize_t show_##name(struct sys_device *dev, char *buf)  \
+static ssize_t show_##name(struct sys_device *dev,             \
+               struct sysdev_attribute *attr, char *buf)       \
 {                                                              \
        unsigned int cpu = dev->id;                             \
        return sprintf(buf, "%d\n", topology_##name(cpu));      \
@@ -59,14 +60,17 @@ static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
 
 #ifdef arch_provides_topology_pointers
 #define define_siblings_show_map(name)                                 \
-static ssize_t show_##name(struct sys_device *dev, char *buf)  \
+static ssize_t show_##name(struct sys_device *dev,                     \
+                          struct sysdev_attribute *attr, char *buf)    \
 {                                                                      \
        unsigned int cpu = dev->id;                                     \
        return show_cpumap(0, &(topology_##name(cpu)), buf);            \
 }
 
 #define define_siblings_show_list(name)                                        \
-static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
+static ssize_t show_##name##_list(struct sys_device *dev,              \
+                                 struct sysdev_attribute *attr,        \
+                                 char *buf)                            \
 {                                                                      \
        unsigned int cpu = dev->id;                                     \
        return show_cpumap(1, &(topology_##name(cpu)), buf);            \
@@ -74,7 +78,8 @@ static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
 
 #else
 #define define_siblings_show_map(name)                                 \
-static ssize_t show_##name(struct sys_device *dev, char *buf)  \
+static ssize_t show_##name(struct sys_device *dev,                     \
+                          struct sysdev_attribute *attr, char *buf)    \
 {                                                                      \
        unsigned int cpu = dev->id;                                     \
        cpumask_t mask = topology_##name(cpu);                          \
@@ -82,7 +87,9 @@ static ssize_t show_##name(struct sys_device *dev, char *buf) \
 }
 
 #define define_siblings_show_list(name)                                        \
-static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
+static ssize_t show_##name##_list(struct sys_device *dev,              \
+                                 struct sysdev_attribute *attr,        \
+                                 char *buf)                            \
 {                                                                      \
        unsigned int cpu = dev->id;                                     \
        cpumask_t mask = topology_##name(cpu);                          \
@@ -93,47 +100,27 @@ static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
 #define define_siblings_show_func(name)                \
        define_siblings_show_map(name); define_siblings_show_list(name)
 
-#ifdef topology_physical_package_id
 define_id_show_func(physical_package_id);
 define_one_ro(physical_package_id);
-#define ref_physical_package_id_attr   &attr_physical_package_id.attr,
-#else
-#define ref_physical_package_id_attr
-#endif
 
-#ifdef topology_core_id
 define_id_show_func(core_id);
 define_one_ro(core_id);
-#define ref_core_id_attr               &attr_core_id.attr,
-#else
-#define ref_core_id_attr
-#endif
 
-#ifdef topology_thread_siblings
 define_siblings_show_func(thread_siblings);
 define_one_ro(thread_siblings);
 define_one_ro(thread_siblings_list);
-#define ref_thread_siblings_attr       \
-               &attr_thread_siblings.attr, &attr_thread_siblings_list.attr,
-#else
-#define ref_thread_siblings_attr
-#endif
 
-#ifdef topology_core_siblings
 define_siblings_show_func(core_siblings);
 define_one_ro(core_siblings);
 define_one_ro(core_siblings_list);
-#define ref_core_siblings_attr         \
-               &attr_core_siblings.attr, &attr_core_siblings_list.attr,
-#else
-#define ref_core_siblings_attr
-#endif
 
 static struct attribute *default_attrs[] = {
-       ref_physical_package_id_attr
-       ref_core_id_attr
-       ref_thread_siblings_attr
-       ref_core_siblings_attr
+       &attr_physical_package_id.attr,
+       &attr_core_id.attr,
+       &attr_thread_siblings.attr,
+       &attr_thread_siblings_list.attr,
+       &attr_core_siblings.attr,
+       &attr_core_siblings_list.attr,
        NULL
 };