* [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c
@ 2009-12-24 3:05 Rakib Mullick
2009-12-30 23:29 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Rakib Mullick @ 2009-12-24 3:05 UTC (permalink / raw)
To: LKML; +Cc: Lee Schermerhorn, Andrew Morton
The patch titled hugetlb-add-per-node-hstate-attributes.patch introduces
the following section mismatch warning, due to a reference form non-init
function hugetlb_register_node to a init function hugetlb_sysfs_add_hstate.
LD mm/built-in.o
WARNING: mm/built-in.o(.text+0x5396d): Section mismatch in reference
from the function hugetlb_register_node() to the function
.init.text:hugetlb_sysfs_add_hstate()
The function hugetlb_register_node() references
the function __init hugetlb_sysfs_add_hstate().
This is often because hugetlb_register_node lacks a __init
annotation or the annotation of hugetlb_sysfs_add_hstate is wrong.
---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
--- linus/mm/hugetlb.c 2009-12-18 15:52:35.000000000 +0600
+++ rakib/mm/hugetlb.c 2009-12-23 20:37:16.000000000 +0600
@@ -1515,7 +1515,7 @@ static struct attribute_group hstate_att
.attrs = hstate_attrs,
};
-static int __init hugetlb_sysfs_add_hstate(struct hstate *h,
+static int hugetlb_sysfs_add_hstate(struct hstate *h,
struct kobject *parent,
struct kobject **hstate_kobjs,
struct attribute_group *hstate_attr_group)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c
2009-12-24 3:05 [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c Rakib Mullick
@ 2009-12-30 23:29 ` Andrew Morton
2010-01-01 14:52 ` Rakib Mullick
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-12-30 23:29 UTC (permalink / raw)
To: Rakib Mullick; +Cc: LKML, Lee Schermerhorn
On Thu, 24 Dec 2009 09:05:48 +0600
Rakib Mullick <rakib.mullick@gmail.com> wrote:
> The patch titled hugetlb-add-per-node-hstate-attributes.patch introduces
> the following section mismatch warning, due to a reference form non-init
> function hugetlb_register_node to a init function hugetlb_sysfs_add_hstate.
>
> LD mm/built-in.o
> WARNING: mm/built-in.o(.text+0x5396d): Section mismatch in reference
> from the function hugetlb_register_node() to the function
> .init.text:hugetlb_sysfs_add_hstate()
> The function hugetlb_register_node() references
> the function __init hugetlb_sysfs_add_hstate().
> This is often because hugetlb_register_node lacks a __init
> annotation or the annotation of hugetlb_sysfs_add_hstate is wrong.
>
> ---
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
>
> --- linus/mm/hugetlb.c 2009-12-18 15:52:35.000000000 +0600
> +++ rakib/mm/hugetlb.c 2009-12-23 20:37:16.000000000 +0600
> @@ -1515,7 +1515,7 @@ static struct attribute_group hstate_att
> .attrs = hstate_attrs,
> };
>
> -static int __init hugetlb_sysfs_add_hstate(struct hstate *h,
> +static int hugetlb_sysfs_add_hstate(struct hstate *h,
> struct kobject *parent,
> struct kobject **hstate_kobjs,
> struct attribute_group *hstate_attr_group)
I would be better to fix it the other way. AFACIT,
hugetlb_register_node() and both versions of
hugetlb_register_all_nodes() should be marked __init.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c
2009-12-30 23:29 ` Andrew Morton
@ 2010-01-01 14:52 ` Rakib Mullick
0 siblings, 0 replies; 3+ messages in thread
From: Rakib Mullick @ 2010-01-01 14:52 UTC (permalink / raw)
To: Andrew Morton; +Cc: LKML, Lee Schermerhorn
On 12/31/09, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> I would be better to fix it the other way. AFACIT,
> hugetlb_register_node() and both versions of
> hugetlb_register_all_nodes() should be marked __init.
>
Okay. Thanks for suggestion.
-----
Since hugetlb_sysfs_add_hstate()'s ancestor function is from __init
and isn't referencing from any other function, so we can do it.
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
---
--- linus/mm/hugetlb.c 2010-01-01 20:31:10.000000000 +0600
+++ rakib/mm/hugetlb.c 2010-01-01 20:26:58.000000000 +0600
@@ -1650,7 +1650,7 @@ static void hugetlb_unregister_all_nodes
* Register hstate attributes for a single node sysdev.
* No-op if attributes already registered.
*/
-void hugetlb_register_node(struct node *node)
+void __init hugetlb_register_node(struct node *node)
{
struct hstate *h;
struct node_hstate *nhs = &node_hstates[node->sysdev.id];
@@ -1683,7 +1683,7 @@ void hugetlb_register_node(struct node *
* sysdevs of nodes that have memory. All on-line nodes should have
* registered their associated sysdev by this time.
*/
-static void hugetlb_register_all_nodes(void)
+static void __init hugetlb_register_all_nodes(void)
{
int nid;
@@ -1712,7 +1712,7 @@ static struct hstate *kobj_to_node_hstat
static void hugetlb_unregister_all_nodes(void) { }
-static void hugetlb_register_all_nodes(void) { }
+static void __init hugetlb_register_all_nodes(void) { }
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-01 14:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24 3:05 [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c Rakib Mullick
2009-12-30 23:29 ` Andrew Morton
2010-01-01 14:52 ` Rakib Mullick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).