Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754348AbbFCPnF (ORCPT ); Wed, 3 Jun 2015 11:43:05 -0400 Received: from g4t3425.houston.hp.com ([15.201.208.53]:23601 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbbFCPm5 (ORCPT ); Wed, 3 Jun 2015 11:42:57 -0400 Message-ID: <1433345001.23540.157.camel@misato.fc.hp.com> Subject: Re: [PATCH 3/3] libnvdimm: Add sysfs numa_node to NVDIMM devices From: Toshi Kani To: Dan Williams Cc: "Rafael J. Wysocki" , Linux ACPI , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" Date: Wed, 03 Jun 2015 09:23:21 -0600 In-Reply-To: References: <1433291212-23367-1-git-send-email-toshi.kani@hp.com> <1433291212-23367-4-git-send-email-toshi.kani@hp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 40 On Tue, 2015-06-02 at 19:51 -0700, Dan Williams wrote: > On Tue, Jun 2, 2015 at 6:01 PM, Dan Williams wrote: > > On Tue, Jun 2, 2015 at 5:26 PM, Toshi Kani 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/