Commit 8f2f5f1e authored by Vincent Stehlé's avatar Vincent Stehlé Committed by Jiri Slaby

topology: Fix compilation warning when not in SMP

commit 53974e06 upstream.

The topology_##name() macro does not use its argument when CONFIG_SMP is not
set, as it ultimately calls the cpu_data() macro.

So we avoid maintaining a possibly unused `cpu' variable, to avoid the
following compilation warning:

  drivers/base/topology.c: In function ‘show_physical_package_id’:
  drivers/base/topology.c:103:118: warning: unused variable ‘cpu’ [-Wunused-variable]
   define_id_show_func(physical_package_id);

  drivers/base/topology.c: In function ‘show_core_id’:
  drivers/base/topology.c:106:106: warning: unused variable ‘cpu’ [-Wunused-variable]
   define_id_show_func(core_id);

This can be seen with e.g. x86 defconfig and CONFIG_SMP not set.
Signed-off-by: default avatarVincent Stehlé <vincent.stehle@laposte.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 51f4c06e
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
static ssize_t show_##name(struct device *dev, \ static ssize_t show_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \ struct device_attribute *attr, char *buf) \
{ \ { \
unsigned int cpu = dev->id; \ return sprintf(buf, "%d\n", topology_##name(dev->id)); \
return sprintf(buf, "%d\n", topology_##name(cpu)); \
} }
#if defined(topology_thread_cpumask) || defined(topology_core_cpumask) || \ #if defined(topology_thread_cpumask) || defined(topology_core_cpumask) || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment