public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: Fix section mismatch in memcontrol.c
@ 2009-01-13  5:39 Rakib Mullick
  2009-01-13  5:49 ` Li Zefan
  0 siblings, 1 reply; 9+ messages in thread
From: Rakib Mullick @ 2009-01-13  5:39 UTC (permalink / raw)
  To: Linux-kernel Mailing List; +Cc: mingo, Andrew Morton

Impact: Fix section mismatch warning.

The annotation for __init in enable_swap_cgroup() and __initdata for
really_do_swap_account produces the following warning. Which is not
right, since this function is called from non-init section. This patch
fixes it. If anything else please notice.

  LD      mm/built-in.o
WARNING: mm/built-in.o(.text+0x277d9): Section mismatch in reference
from the function mem_cgroup_create() to the function
.init.text:enable_swap_cgroup()
The function mem_cgroup_create() references
the function __init enable_swap_cgroup().
This is often because mem_cgroup_create lacks a __init
annotation or the annotation of enable_swap_cgroup is wrong.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linux-2.6-orig/mm/memcontrol.c	2009-01-12 09:53:10.000000000 +0600
+++ linux-2.6/mm/memcontrol.c	2009-01-12 19:40:06.134648480 +0600
@@ -46,7 +46,7 @@ struct cgroup_subsys mem_cgroup_subsys _
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
 /* Turned on only when memory cgroup is enabled &&
really_do_swap_account = 0 */
 int do_swap_account __read_mostly;
-static int really_do_swap_account __initdata = 1; /* for remember boot option*/
+static int really_do_swap_account = 1; /* for remember boot option*/
 #else
 #define do_swap_account		(0)
 #endif
@@ -2170,13 +2170,13 @@ static void mem_cgroup_put(struct mem_cg


 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
-static void __init enable_swap_cgroup(void)
+static void enable_swap_cgroup(void)
 {
 	if (!mem_cgroup_disabled() && really_do_swap_account)
 		do_swap_account = 1;
 }
 #else
-static void __init enable_swap_cgroup(void)
+static void enable_swap_cgroup(void)
 {
 }
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] mm: Fix section mismatch in memcontrol.c
@ 2009-01-13  5:39 Rakib Mullick
  0 siblings, 0 replies; 9+ messages in thread
From: Rakib Mullick @ 2009-01-13  5:39 UTC (permalink / raw)
  To: Linux-kernel Mailing List; +Cc: mingo, Andrew Morton

Impact: Fix section mismatch warning.

The annotation for __init in enable_swap_cgroup() and __initdata for
really_do_swap_account produces the following warning. Which is not
right, since this function is called from non-init section. This patch
fixes it.

  LD      mm/built-in.o
WARNING: mm/built-in.o(.text+0x277d9): Section mismatch in reference
from the function mem_cgroup_create() to the function
.init.text:enable_swap_cgroup()
The function mem_cgroup_create() references
the function __init enable_swap_cgroup().
This is often because mem_cgroup_create lacks a __init
annotation or the annotation of enable_swap_cgroup is wrong.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linux-2.6-orig/mm/memcontrol.c	2009-01-12 09:53:10.000000000 +0600
+++ linux-2.6/mm/memcontrol.c	2009-01-12 19:40:06.134648480 +0600
@@ -46,7 +46,7 @@ struct cgroup_subsys mem_cgroup_subsys _
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
 /* Turned on only when memory cgroup is enabled &&
really_do_swap_account = 0 */
 int do_swap_account __read_mostly;
-static int really_do_swap_account __initdata = 1; /* for remember boot option*/
+static int really_do_swap_account = 1; /* for remember boot option*/
 #else
 #define do_swap_account		(0)
 #endif
@@ -2170,13 +2170,13 @@ static void mem_cgroup_put(struct mem_cg


 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
-static void __init enable_swap_cgroup(void)
+static void enable_swap_cgroup(void)
 {
 	if (!mem_cgroup_disabled() && really_do_swap_account)
 		do_swap_account = 1;
 }
 #else
-static void __init enable_swap_cgroup(void)
+static void enable_swap_cgroup(void)
 {
 }
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-14  6:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13  5:39 [PATCH] mm: Fix section mismatch in memcontrol.c Rakib Mullick
2009-01-13  5:49 ` Li Zefan
2009-01-13  6:13   ` KAMEZAWA Hiroyuki
2009-01-14  4:43     ` Rakib Mullick
2009-01-14  5:00       ` KAMEZAWA Hiroyuki
2009-01-14  5:05         ` Rakib Mullick
2009-01-14  5:14         ` Li Zefan
2009-01-14  6:49           ` KAMEZAWA Hiroyuki
  -- strict thread matches above, loose matches on Subject: below --
2009-01-13  5:39 Rakib Mullick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox