Skip to contentSkip to conversation

sparc64: fix section mismatch warning in mdesc.c

PATCH Applied Sam Ravnborg 2 participants 2 messages Jul 20, 2007 – Jul 21, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 sparc64: fix section mismatch warning in mdesc.c

Wrong list address in first try.

----- Forwarded message from Sam Ravnborg <[email protected]> -----

Subject: [PATCH 7/7] sparc64: fix section mismatch warning in mdesc.c
Sender: [email protected]
From: Sam Ravnborg <[email protected]>
Date: Fri, 20 Jul 2007 23:31:30 +0200
User-Agent: Mutt/1.4.2.1i
To: LKML <[email protected]>,
David Miller <[email protected]>, [email protected]
Cc: Andrew Morton <[email protected]>
X-Mailing-List: [email protected]

Fix following warning:
WARNING: vmlinux.o(.text+0x35264): Section mismatch: reference to .init.text:__alloc_bootmem (between 'mdesc_bootmem_alloc' and 'mdesc_bootmem_free')

Rename mdesc_mem_ops to *_ops so modpost ignores __init references and declare mdesc_bootmem_alloc __init since it is only used during __init context.

---
 arch/sparc64/kernel/mdesc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/sparc64/kernel/mdesc.c +3 -3
index 13a79fe..cce4d0d 100644
@@ -83,7 +83,7 @@ static void mdesc_handle_init(struct mdesc_handle *hp,
 	hp->handle_size = handle_size;
 }
 
-static struct mdesc_handle *mdesc_bootmem_alloc(unsigned int mdesc_size)
+static struct mdesc_handle * __init mdesc_bootmem_alloc(unsigned int mdesc_size)
 {
 	struct mdesc_handle *hp;
 	unsigned int handle_size, alloc_size;
@@ -123,7 +123,7 @@ static void mdesc_bootmem_free(struct mdesc_handle *hp)
 	}
 }
 
-static struct mdesc_mem_ops bootmem_mdesc_memops = {
+static struct mdesc_mem_ops bootmem_mdesc_ops = {
 	.alloc = mdesc_bootmem_alloc,
 	.free  = mdesc_bootmem_free,
 };
@@ -860,7 +860,7 @@ void __init sun4v_mdesc_init(void)
 
 	printk("MDESC: Size is %lu bytes.\n", len);
 
-	hp = mdesc_alloc(len, &bootmem_mdesc_memops);
+	hp = mdesc_alloc(len, &bootmem_mdesc_ops);
 	if (hp = NULL) {
 		prom_printf("MDESC: alloc of %lu bytes failed.\n", len);
 		prom_halt();
Signature · 9 lines
1.5.1.rc3.g84b7-dirty

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

----- End forwarded message -----
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Fri, 20 Jul 2007 23:34:55 +0200

Quoted 8 lines

Fix following warning:
WARNING: vmlinux.o(.text+0x35264): Section mismatch: reference to .init.text:__alloc_bootmem (between 'mdesc_bootmem_alloc' and 'mdesc_bootmem_free')

Rename mdesc_mem_ops to *_ops so modpost ignores __init references and declare mdesc_bootmem_alloc __init since it is only used during __init context.

Also applied, thanks Sam.