Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1157793
| From | Toshi Kani <toshi.kani@hp.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices |
| Date | 2015-06-03 17:50 +0200 |
| Message-ID | <pxj5x-5s8-27@gated-at.bofh.it> (permalink) |
| References | <px52x-1bs-3@gated-at.bofh.it> <px52y-1bs-11@gated-at.bofh.it> <px5lU-1O2-5@gated-at.bofh.it> <px74l-4dC-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices Toshi Kani <toshi.kani@hp.com> - 2015-06-03 02:50 +0200
Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices Dan Williams <dan.j.williams@intel.com> - 2015-06-03 03:10 +0200
Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices Toshi Kani <toshi.kani@hp.com> - 2015-06-03 17:50 +0200
csiph-web