Skip to contentSkip to conversation

Squash hotplug warnings

PATCH In review Andy Whitcroft 3 participants 8 messages Nov 14, 2005 – Nov 15, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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
diff -upN reference/mm/memory_hotplug.c current/mm/memory_hotplug.c
@@ -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;
 
#2 lore raw

PATCH 2/4 register_ and unregister_memory_notifier should be global

In reply to Andy Whitcroft

Both 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
diff -upN reference/drivers/base/memory.c current/drivers/base/memory.c
@@ -50,12 +50,12 @@ static struct kset_hotplug_ops memory_ho
 
 static 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);
 }
#3 lore raw

Re: [PATCH 2/4] register_ and unregister_memory_notifier should be global

Quoted 5 lines · Andy Whitcroft

Both 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.

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.c current/drivers/base/memory.c

drivers/base/memory.c +2 -2
@@ -50,12 +50,12 @@ static struct kset_hotplug_ops memory_ho
 
 static 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);
 }
#4 lore raw

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_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.

There is no linux.h and I can find no .h file which declares register_memory_notifier(). Please clarify?

I'm pretty sure Andy meant to say <linux/memory.h> not linux.h.

Signature · 1 line
Mike
#5 lore raw

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_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.

There is no linux.h and I can find no .h file which declares register_memory_notifier(). Please clarify?

I'm pretty sure Andy meant to say <linux/memory.h> not linux.h.

hm, OK, and I just lost my grep license. Thanks.

#6 lore raw

PATCH 3/4 register_memory should be global

In reply to Andy Whitcroft

register_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
diff -upN reference/drivers/base/memory.c current/drivers/base/memory.c
@@ -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;
#7 lore raw

PATCH 4/4 memory_hotplug_name should be const

In reply to Andy Whitcroft

The 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
diff -upN reference/drivers/base/memory.c current/drivers/base/memory.c
@@ -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;
 }