Squash hotplug warnings
Subsystems (3)
cover Squash hotplug warnings
Following this mail are 4 small patches cleaning up some Warnings introduced in the merge of the hotplug code:
__add_section remove unused pgdat definition register_ and unregister_memory_notifier should be global register_memory should be global memory_hotplug_name should be const
These are against 2.6.14-mm2. Please consider for -mm.
-apw
PATCH 1/4 __add_section remove unused pgdat definition
__add_section defines an unused pointer to the zones pgdat. Remove this definition. This fixes a compile warning.
--- memory_hotplug.c | 1 - 1 file changed, 1 deletion(-)
mm/memory_hotplug.c +0 -1
@@ -42,7 +42,6 @@ extern int sparse_add_one_section(struct int nr_pages);static int __add_section (struct zone *zone,unsigned long phys_start_pfn) { -struct pglist_data *pgdat = zone->zone_pgdat;int nr_pages =PAGES_PER_SECTION ;int ret;
PATCH 2/4 register_ and unregister_memory_notifier should be global
In reply to Andy WhitcroftBoth register_memory_notifer and unregister_memory_notifier are global and declared so in linux.h. Update the HOTPLUG specific definitions to match. This fixes a compile warning when HOTPLUG is enabled.
--- memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/memory.c +2 -2
@@ -50,12 +50,12 @@ static struct kset_hotplug_ops memory_hostatic struct notifier_block *memory_chain; -static int register_memory_notifier (struct notifier_block *nb) +int register_memory_notifier (struct notifier_block *nb) {return notifier_chain_register (&memory_chain, nb); } -static void unregister_memory_notifier (struct notifier_block *nb) +void unregister_memory_notifier (struct notifier_block *nb) {notifier_chain_unregister (&memory_chain, nb); }
Re: [PATCH 2/4] register_ and unregister_memory_notifier should be global
Quoted 5 lines · Andy Whitcroft
Both
register_memory_notiferandunregister_memory_notifierare global and declared so inlinux.h. Update the HOTPLUG specific definitions to match. This fixes a compile warning when HOTPLUG is enabled.
There is no linux.h and I can find no .h file which declares register_memory_notifier(). Please clarify?
Quoted 21 lines
--- memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff -upN
reference/drivers/base/memory.ccurrent/drivers/base/memory.cdrivers/base/memory.c +2
-2@@ -50,12 +50,12 @@ static struct kset_hotplug_ops memory_hostatic struct notifier_block *memory_chain; -static int register_memory_notifier (struct notifier_block *nb) +int register_memory_notifier (struct notifier_block *nb) {return notifier_chain_register (&memory_chain, nb); } -static void unregister_memory_notifier (struct notifier_block *nb) +void unregister_memory_notifier (struct notifier_block *nb) {notifier_chain_unregister (&memory_chain, nb); }
Re: [PATCH 2/4] register_ and unregister_memory_notifier should be global
Quoted 8 lines · Andrew Morton
Quoted 4 lines · Andy Whitcroft
Both
register_memory_notiferandunregister_memory_notifierare global and declared so inlinux.h. Update the HOTPLUG specific definitions to match. This fixes a compile warning when HOTPLUG is enabled.There is no
linux.hand I can find no .h file which declaresregister_memory_notifier(). Please clarify?
I'm pretty sure Andy meant to say <linux/memory.h> not linux.h.
Signature · 1 line
Mike
Re: [PATCH 2/4] register_ and unregister_memory_notifier should be global
Quoted 4 lines · mike kravetz
Quoted 2 lines · Andrew Morton
Quoted 1 line · Andy Whitcroft
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Both
register_memory_notiferandunregister_memory_notifierare global and declared so inlinux.h. Update the HOTPLUG specific definitions to match. This fixes a compile warning when HOTPLUG is enabled.There is no
linux.hand I can find no .h file which declaresregister_memory_notifier(). Please clarify?I'm pretty sure Andy meant to say <
linux/memory.h> notlinux.h.
hm, OK, and I just lost my grep license. Thanks.
PATCH 3/4 register_memory should be global
In reply to Andy Whitcroftregister_memory is global and declared so in linux.h. Update the HOTPLUG specific definition to match. This fixes a compile warning when HOTPLUG is enabled.
--- memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/base/memory.c +1 -2
@@ -63,8 +63,7 @@ void unregister_memory_notifier(struct n/* * register_memory - Setup a sysfs device for a memory block */ -static int -register_memory (struct memory_block *memory,struct mem_section *section, +int register_memory (struct memory_block *memory,struct mem_section *section,struct node *root) {int error;
PATCH 4/4 memory_hotplug_name should be const
In reply to Andy WhitcroftThe hotplug ops name entry for memory (memory_hotplug_name) should be const. This fixes a compiler warning when HOTPLUG is enabled.
--- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c +1 -1
@@ -30,7 +30,7 @@ static struct sysdev_class memory_sysdev };EXPORT_SYMBOL (memory_sysdev_class); -static char *memory_hotplug_name (struct kset *kset,struct kobject *kobj) +static const char *memory_hotplug_name (struct kset *kset,struct kobject *kobj) {return MEMORY_CLASS_NAME ; }