Skip to content

Commit c95ce3a

Browse files
committed
topology: Fix up build warning in topology_is_visible()
Commit aa63a74 ("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: aa63a74 ("topology/sysfs: Hide PPIN on systems that do not support it.") Cc: Tony Luck <[email protected]> Reported-by: Stephen Rothwell <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1dc9f1a commit c95ce3a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/base/topology.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ static struct attribute *default_attrs[] = {
155155
static umode_t topology_is_visible(struct kobject *kobj,
156156
struct attribute *attr, int unused)
157157
{
158-
struct device *dev = kobj_to_dev(kobj);
159-
160-
if (attr == &dev_attr_ppin.attr && !topology_ppin(dev->id))
158+
if (attr == &dev_attr_ppin.attr && !topology_ppin(kobj_to_dev(kobj)->id))
161159
return 0;
162160

163161
return attr->mode;

0 commit comments

Comments
 (0)