aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorLi Zhong <zhong@linux.vnet.ibm.com>2014-06-04 19:07:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:53:58 -0400
commit56a3c655a3d31cb1afef25b530b5ef6a1e7ddefd (patch)
treea4239563e740cce14dc52d5468a7fd880582a92d /drivers/base/memory.c
parente4f674229ce63dac60be0c4ddfb5ef8d1225d30d (diff)
memory-hotplug: update documentation to hide information about SECTIONS and remove end_phys_index
Seems we all agree that information about SECTION, e.g. section size, sections per memory block should be kept as kernel internals, and not exposed to userspace. This patch updates Documentation/memory-hotplug.txt to refer to memory blocks instead of memory sections where appropriate and added a paragraph to explain that memory blocks are made of memory sections. The documentation update is mostly provided by Nathan. Also, as end_phys_index in code is actually not the end section id, but the end memory block id, which should always be the same as phys_index. So it is removed here. Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index bece691cb5d9..89f752dd8465 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -118,16 +118,6 @@ static ssize_t show_mem_start_phys_index(struct device *dev,
118 return sprintf(buf, "%08lx\n", phys_index); 118 return sprintf(buf, "%08lx\n", phys_index);
119} 119}
120 120
121static ssize_t show_mem_end_phys_index(struct device *dev,
122 struct device_attribute *attr, char *buf)
123{
124 struct memory_block *mem = to_memory_block(dev);
125 unsigned long phys_index;
126
127 phys_index = mem->end_section_nr / sections_per_block;
128 return sprintf(buf, "%08lx\n", phys_index);
129}
130
131/* 121/*
132 * Show whether the section of memory is likely to be hot-removable 122 * Show whether the section of memory is likely to be hot-removable
133 */ 123 */
@@ -384,7 +374,6 @@ static ssize_t show_phys_device(struct device *dev,
384} 374}
385 375
386static DEVICE_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL); 376static DEVICE_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL);
387static DEVICE_ATTR(end_phys_index, 0444, show_mem_end_phys_index, NULL);
388static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state); 377static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state);
389static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL); 378static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL);
390static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL); 379static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL);
@@ -529,7 +518,6 @@ struct memory_block *find_memory_block(struct mem_section *section)
529 518
530static struct attribute *memory_memblk_attrs[] = { 519static struct attribute *memory_memblk_attrs[] = {
531 &dev_attr_phys_index.attr, 520 &dev_attr_phys_index.attr,
532 &dev_attr_end_phys_index.attr,
533 &dev_attr_state.attr, 521 &dev_attr_state.attr,
534 &dev_attr_phys_device.attr, 522 &dev_attr_phys_device.attr,
535 &dev_attr_removable.attr, 523 &dev_attr_removable.attr,