Re: [PATCH] hugetlb: Fix section mismatch warning in hugetlb.c

From: Rakib Mullick
Date: Fri Jan 01 2010 - 09:52:24 EST


On 12/31/09, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxx>
---

--- 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/