Re: [PATCH v2] topology/sysfs: Fix allnoconfig build breakage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux