topology: Fix compilation warning when not in SMP
authorVincent Stehlé <vincent.stehle@laposte.net>
Fri, 4 Apr 2014 06:43:18 +0000 (08:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 20:25:29 +0000 (13:25 -0700)
commited04ce19bcb9518baf9233ed1d93332a4111025a
treed952302c1306655bf0e9c94407b2e31f33582356
parent2ec453bfa65175f1dcf34b6f0ea0539b0e949b5b
topology: Fix compilation warning when not in SMP

commit 53974e06603977f348ed978d75c426b0532daa67 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: Vincent Stehlé <vincent.stehle@laposte.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/topology.c