mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices
Date: Wed, 03 Jun 2015 09:23:21 -0600	[thread overview]
Message-ID: <1433345001.23540.157.camel@misato.fc.hp.com> (raw)
In-Reply-To: <CAPcyv4i3LU2jXm3q1CDzgMAhzzpuYky1g8M6eT3wv_9BxsUnDA@mail.gmail.com>

On Tue, 2015-06-02 at 19:51 -0700, Dan Williams wrote:
> On Tue, Jun 2, 2015 at 6:01 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> > On Tue, Jun 2, 2015 at 5:26 PM, Toshi Kani <toshi.kani@hp.com> wrote:
 :
> >>
> >> +#ifdef CONFIG_NUMA
> >> +static ssize_t numa_node_show(struct device *dev, struct device_attribute *attr,
> >> +               char *buf)
> >> +{
> >> +       return sprintf(buf, "%d\n", dev->numa_node);
> >> +}
> >> +DEVICE_ATTR_RO(numa_node);
> >> +#endif
> >> +
> >>  static struct attribute *nd_device_attributes[] = {
> >>         &dev_attr_modalias.attr,
> >>         &dev_attr_devtype.attr,
> >> +#ifdef CONFIG_NUMA
> >> +       &dev_attr_numa_node.attr,
> >> +#endif
> >>         NULL,
> >>  };
> >
> > I'd prefer you define is_visible() in the nd_device_attribute_group
> > and gate showing this attribute on IS_ENABLED(CONFIG_NUMA) rather than
> > including these ifdef guards.  The ifdef guards aren't necessary in
> > the CONFIG_NUMA=n case.
> 
> I also think is_visible() should hide this attribute on is_nvdimm() devices.

Agreed.  Will do.

Thanks,
-Toshi


      reply	other threads:[~2015-06-03 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03  0:26 [PATCH 0/3] Add NUMA support for " Toshi Kani
2015-06-03  0:26 ` [PATCH 1/3] acpi: Fix acpi_map_pxm_to_node() to handle numa_off Toshi Kani
2015-06-06  0:33   ` Toshi Kani
2015-06-03  0:26 ` [PATCH 2/3] acpi: Add export to acpi_map_pxm_to_node() Toshi Kani
2015-06-03  0:26 ` [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices Toshi Kani
2015-06-03  1:01   ` Dan Williams
2015-06-03  2:51     ` Dan Williams
2015-06-03 15:23       ` Toshi Kani [this message]

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=1433345001.23540.157.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=rjw@rjwysocki.net \
    /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

all inboxes | Powered by JetHome®