summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-03-29 21:25:29 -0700
committerDavid S. Miller <davem@davemloft.net>2020-03-29 21:25:29 -0700
commitf0b5989745c3e0e92424d36869a97e4e8df7ab13 (patch)
tree0e9759b9d6060bb94cad676b1b16e423d5ad2523 /drivers/base
parent1a147b74c2fd4058dea0133cb2471724c3b3de09 (diff)
parent7111951b8d4973bda27ff663f2cf18b663d15b48 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor comment conflict in mac80211. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/memory.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index b9f474c11393..4086718f6876 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -97,30 +97,13 @@ static ssize_t phys_index_show(struct device *dev,
}
/*
- * Show whether the memory block is likely to be offlineable (or is already
- * offline). Once offline, the memory block could be removed. The return
- * value does, however, not indicate that there is a way to remove the
- * memory block.
+ * Legacy interface that we cannot remove. Always indicate "removable"
+ * with CONFIG_MEMORY_HOTREMOVE - bad heuristic.
*/
static ssize_t removable_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct memory_block *mem = to_memory_block(dev);
- unsigned long pfn;
- int ret = 1, i;
-
- if (mem->state != MEM_ONLINE)
- goto out;
-
- for (i = 0; i < sections_per_block; i++) {
- if (!present_section_nr(mem->start_section_nr + i))
- continue;
- pfn = section_nr_to_pfn(mem->start_section_nr + i);
- ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
- }
-
-out:
- return sprintf(buf, "%d\n", ret);
+ return sprintf(buf, "%d\n", (int)IS_ENABLED(CONFIG_MEMORY_HOTREMOVE));
}
/*