[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200113113354.6341-3-david@redhat.com>
Date: Mon, 13 Jan 2020 12:33:54 +0100
From: David Hildenbrand <david@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, David Hildenbrand <david@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Michal Hocko <mhocko@...e.com>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Oscar Salvador <osalvador@...e.de>
Subject: [PATCH v1 2/2] drivers/base/memory.c: get rid of find_memory_block()
No longer needed, remove it.
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Pavel Tatashin <pasha.tatashin@...een.com>
Cc: Anshuman Khandual <anshuman.khandual@....com>
Cc: Oscar Salvador <osalvador@...e.de>
Signed-off-by: David Hildenbrand <david@...hat.com>
---
drivers/base/memory.c | 9 +--------
include/linux/memory.h | 1 -
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 2cf3542b04d0..8b3ab910b812 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -590,13 +590,6 @@ static struct memory_block *find_memory_block_by_id(unsigned long block_id)
return mem;
}
-struct memory_block *find_memory_block(struct mem_section *section)
-{
- unsigned long block_id = base_memory_block_id(__section_nr(section));
-
- return find_memory_block_by_id(block_id);
-}
-
static struct attribute *memory_memblk_attrs[] = {
&dev_attr_phys_index.attr,
&dev_attr_state.attr,
@@ -700,7 +693,7 @@ static void unregister_memory(struct memory_block *memory)
WARN_ON(radix_tree_delete(&memory_blocks, memory->dev.id) == NULL);
- /* drop the ref. we got via find_memory_block() */
+ /* drop the ref. we got via find_memory_block_by_id() */
put_device(&memory->dev);
device_unregister(&memory->dev);
}
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 3ab4aa2d67ae..0b0732a94972 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -113,7 +113,6 @@ void remove_memory_block_devices(unsigned long start, unsigned long size);
extern void memory_dev_init(void);
extern int memory_notify(unsigned long val, void *v);
extern int memory_isolate_notify(unsigned long val, void *v);
-extern struct memory_block *find_memory_block(struct mem_section *);
typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
extern int walk_memory_blocks(unsigned long start, unsigned long size,
void *arg, walk_memory_blocks_func_t func);
--
2.24.1
Powered by blists - more mailing lists