lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] topology/sysfs: Fix allnoconfig build breakage.
On Fri, Apr 22, 2022 at 08:00:50AM +0200, Greg KH wrote:
> On Thu, Apr 21, 2022 at 07:51:02PM -0700, Luck, Tony wrote:
> > On Fri, Apr 22, 2022 at 10:00:54AM +1000, Stephen Rothwell wrote:
> > > I assume that there is some good reason that topology_ppin() is not
> > > implemented as a static inline function?
> >
> > I don't think so. I just cut & pasted how all the other topology_*()
> > things were implemented.
> >
> > Making it a static inline appears to fix this problem. But before
> > embarrassing myself with a third broken version I'll let zero day
> > crunch on:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git hide_ppin
> >
> > to see if there is some subtle config or arch where the inline trick
> > doesn't work.
> >
> > Thanks for the idea! :-)
>
> Why not just do the following, which passes my build tests here:
>
>
> 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;

I've sent this as real patch now.

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-04-22 08:28    [W:0.047 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site