summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 08:26:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-23 12:53:11 +0200
commitc95ce3a23dcda678f6f7811dd39b6d14eeb6f192 (patch)
tree857264d95fffd5f0a191fa1e41a21d07ae823aa1 /drivers/base
parent1dc9f1a66e1718479e1c4f95514e1750602a3cb9 (diff)
downloadlinux-c95ce3a23dcda678f6f7811dd39b6d14eeb6f192.tar.gz
linux-c95ce3a23dcda678f6f7811dd39b6d14eeb6f192.tar.bz2
linux-c95ce3a23dcda678f6f7811dd39b6d14eeb6f192.zip
topology: Fix up build warning in topology_is_visible()
Commit aa63a74d4535 ("topology/sysfs: Hide PPIN on systems that do not support it.") caused a build warning on some configurations: drivers/base/topology.c: In function 'topology_is_visible': drivers/base/topology.c:158:24: warning: unused variable 'dev' [-Wunused-variable] 158 | struct device *dev = kobj_to_dev(kobj); Fix this up by getting rid of the variable entirely. Fixes: aa63a74d4535 ("topology/sysfs: Hide PPIN on systems that do not support it.") Cc: Tony Luck <tony.luck@intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/20220422062653.3899972-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/topology.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 706dbf8bf249..ac6ad9ab67f9 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -155,9 +155,7 @@ static struct attribute *default_attrs[] = {
static umode_t topology_is_visible(struct kobject *kobj,
struct attribute *attr, int unused)
{
- struct device *dev = kobj_to_dev(kobj);
-
- if (attr == &dev_attr_ppin.attr && !topology_ppin(dev->id))
+ if (attr == &dev_attr_ppin.attr && !topology_ppin(kobj_to_dev(kobj)->id))
return 0;
return attr->mode;