Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnvdimm: Convert to DEVICE_ATTR_ADMIN_RO()

Move libnvdimm sysfs attributes that currently use an open coded
DEVICE_ATTR() to hide sensitive root-only information (physical memory
layout) to the new DEVICE_ATTR_ADMIN_RO() helper.

Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

authored by

Dan Williams and committed by
Vishal Verma
5cf81ce1 60d360ac

+3 -3
+1 -1
drivers/nvdimm/namespace_devs.c
··· 1309 1309 return -ENXIO; 1310 1310 return sprintf(buf, "%#llx\n", (unsigned long long) res->start); 1311 1311 } 1312 - static DEVICE_ATTR(resource, 0400, resource_show, NULL); 1312 + static DEVICE_ATTR_ADMIN_RO(resource); 1313 1313 1314 1314 static const unsigned long blk_lbasize_supported[] = { 512, 520, 528, 1315 1315 4096, 4104, 4160, 4224, 0 };
+1 -1
drivers/nvdimm/pfn_devs.c
··· 218 218 219 219 return rc; 220 220 } 221 - static DEVICE_ATTR(resource, 0400, resource_show, NULL); 221 + static DEVICE_ATTR_ADMIN_RO(resource); 222 222 223 223 static ssize_t size_show(struct device *dev, 224 224 struct device_attribute *attr, char *buf)
+1 -1
drivers/nvdimm/region_devs.c
··· 605 605 606 606 return sprintf(buf, "%#llx\n", nd_region->ndr_start); 607 607 } 608 - static DEVICE_ATTR(resource, 0400, resource_show, NULL); 608 + static DEVICE_ATTR_ADMIN_RO(resource); 609 609 610 610 static ssize_t persistence_domain_show(struct device *dev, 611 611 struct device_attribute *attr, char *buf)