public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: [PATCH v2] topology/sysfs: Fix allnoconfig build breakage.
Date: Fri, 22 Apr 2022 08:00:50 +0200	[thread overview]
Message-ID: <YmJEkoVGCnCXb5Ff@kroah.com> (raw)
In-Reply-To: <YmIYFjI/B+33PQn+@agluck-desk3.sc.intel.com>

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;

  reply	other threads:[~2022-04-22  6:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  5:26 linux-next: build warning after merge of the driver-core.current tree Stephen Rothwell
2022-04-21  6:49 ` Greg KH
2022-04-21 15:45   ` [PATCH] topology/sysfs: Fix allnoconfig build breakage Luck, Tony
2022-04-21 15:53     ` Greg KH
2022-04-21 16:19       ` [PATCH v2] " Luck, Tony
2022-04-21 23:22         ` Stephen Rothwell
2022-04-21 23:38           ` Luck, Tony
2022-04-22  0:00             ` Stephen Rothwell
2022-04-22  2:51               ` Luck, Tony
2022-04-22  6:00                 ` Greg KH [this message]
2022-04-22  6:27                   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmJEkoVGCnCXb5Ff@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox