Commit f732e242 authored by Wei Yang's avatar Wei Yang Committed by Andrew Morton

mm/memory_hotplug: get rid of __ref

After commit 73db3abd ("init/modpost: conditionally check section
mismatch to __meminit*"), we can get rid of __ref annotations.

Link: https://lkml.kernel.org/r/20240726010157.6177-1-richard.weiyang@gmail.comSigned-off-by: default avatarWei Yang <richard.weiyang@gmail.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 9f101bef
...@@ -366,7 +366,7 @@ struct page *pfn_to_online_page(unsigned long pfn) ...@@ -366,7 +366,7 @@ struct page *pfn_to_online_page(unsigned long pfn)
} }
EXPORT_SYMBOL_GPL(pfn_to_online_page); EXPORT_SYMBOL_GPL(pfn_to_online_page);
int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages, int __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
struct mhp_params *params) struct mhp_params *params)
{ {
const unsigned long end_pfn = pfn + nr_pages; const unsigned long end_pfn = pfn + nr_pages;
...@@ -524,7 +524,7 @@ static void update_pgdat_span(struct pglist_data *pgdat) ...@@ -524,7 +524,7 @@ static void update_pgdat_span(struct pglist_data *pgdat)
pgdat->node_spanned_pages = node_end_pfn - node_start_pfn; pgdat->node_spanned_pages = node_end_pfn - node_start_pfn;
} }
void __ref remove_pfn_range_from_zone(struct zone *zone, void remove_pfn_range_from_zone(struct zone *zone,
unsigned long start_pfn, unsigned long start_pfn,
unsigned long nr_pages) unsigned long nr_pages)
{ {
...@@ -629,7 +629,7 @@ int restore_online_page_callback(online_page_callback_t callback) ...@@ -629,7 +629,7 @@ int restore_online_page_callback(online_page_callback_t callback)
EXPORT_SYMBOL_GPL(restore_online_page_callback); EXPORT_SYMBOL_GPL(restore_online_page_callback);
/* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */
void __ref generic_online_page(struct page *page, unsigned int order) void generic_online_page(struct page *page, unsigned int order)
{ {
__free_pages_core(page, order, MEMINIT_HOTPLUG); __free_pages_core(page, order, MEMINIT_HOTPLUG);
} }
...@@ -741,7 +741,7 @@ static inline void section_taint_zone_device(unsigned long pfn) ...@@ -741,7 +741,7 @@ static inline void section_taint_zone_device(unsigned long pfn)
* (usually MIGRATE_MOVABLE). Besides setting the migratetype, no related * (usually MIGRATE_MOVABLE). Besides setting the migratetype, no related
* zone stats (e.g., nr_isolate_pageblock) are touched. * zone stats (e.g., nr_isolate_pageblock) are touched.
*/ */
void __ref move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
unsigned long nr_pages, unsigned long nr_pages,
struct vmem_altmap *altmap, int migratetype) struct vmem_altmap *altmap, int migratetype)
{ {
...@@ -1143,7 +1143,7 @@ void mhp_deinit_memmap_on_memory(unsigned long pfn, unsigned long nr_pages) ...@@ -1143,7 +1143,7 @@ void mhp_deinit_memmap_on_memory(unsigned long pfn, unsigned long nr_pages)
/* /*
* Must be called with mem_hotplug_lock in write mode. * Must be called with mem_hotplug_lock in write mode.
*/ */
int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_pages(unsigned long pfn, unsigned long nr_pages,
struct zone *zone, struct memory_group *group) struct zone *zone, struct memory_group *group)
{ {
unsigned long flags; unsigned long flags;
...@@ -1233,7 +1233,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, ...@@ -1233,7 +1233,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
} }
/* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */
static pg_data_t __ref *hotadd_init_pgdat(int nid) static pg_data_t *hotadd_init_pgdat(int nid)
{ {
struct pglist_data *pgdat; struct pglist_data *pgdat;
...@@ -1386,7 +1386,7 @@ bool mhp_supports_memmap_on_memory(void) ...@@ -1386,7 +1386,7 @@ bool mhp_supports_memmap_on_memory(void)
} }
EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory); EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory);
static void __ref remove_memory_blocks_and_altmaps(u64 start, u64 size) static void remove_memory_blocks_and_altmaps(u64 start, u64 size)
{ {
unsigned long memblock_size = memory_block_size_bytes(); unsigned long memblock_size = memory_block_size_bytes();
u64 cur_start; u64 cur_start;
...@@ -1473,7 +1473,7 @@ static int create_altmaps_and_memory_blocks(int nid, struct memory_group *group, ...@@ -1473,7 +1473,7 @@ static int create_altmaps_and_memory_blocks(int nid, struct memory_group *group,
* *
* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG * we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG
*/ */
int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
{ {
struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) }; struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) };
enum memblock_flags memblock_flags = MEMBLOCK_NONE; enum memblock_flags memblock_flags = MEMBLOCK_NONE;
...@@ -1580,7 +1580,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) ...@@ -1580,7 +1580,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
} }
/* requires device_hotplug_lock, see add_memory_resource() */ /* requires device_hotplug_lock, see add_memory_resource() */
int __ref __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags) int __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags)
{ {
struct resource *res; struct resource *res;
int ret; int ret;
...@@ -1939,7 +1939,7 @@ static int count_system_ram_pages_cb(unsigned long start_pfn, ...@@ -1939,7 +1939,7 @@ static int count_system_ram_pages_cb(unsigned long start_pfn,
/* /*
* Must be called with mem_hotplug_lock in write mode. * Must be called with mem_hotplug_lock in write mode.
*/ */
int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages, int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
struct zone *zone, struct memory_group *group) struct zone *zone, struct memory_group *group)
{ {
const unsigned long end_pfn = start_pfn + nr_pages; const unsigned long end_pfn = start_pfn + nr_pages;
...@@ -2240,7 +2240,7 @@ static int memory_blocks_have_altmaps(u64 start, u64 size) ...@@ -2240,7 +2240,7 @@ static int memory_blocks_have_altmaps(u64 start, u64 size)
return 1; return 1;
} }
static int __ref try_remove_memory(u64 start, u64 size) static int try_remove_memory(u64 start, u64 size)
{ {
int rc, nid = NUMA_NO_NODE; int rc, nid = NUMA_NO_NODE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment