lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 03 Jun 2015 09:23:21 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	Dan Williams <dan.j.williams@...el.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Linux ACPI <linux-acpi@...r.kernel.org>,
	"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices

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@...el.com> wrote:
> > On Tue, Jun 2, 2015 at 5:26 PM, Toshi Kani <toshi.kani@...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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ