[PATCH 1/3] UBI: block: Mark init-only symbol as __initdata

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Mon Mar 3 11:42:38 EST 2014


ubiblock_param_ops should be marked as __init as it's only used to set
a driver parameter on insertion time. This commit fixes the following:

  WARNING: drivers/mtd/built-in.o(.text+0x653ac): Section mismatch in
  reference from the variable ubiblock_param_ops to the function
  .init.text:ubiblock_set_param()

  The function ubiblock_param_ops() references the function __init
  ubiblock_set_param(). This is often because ubiblock_param_ops lacks a
  __init annotation or the annotation of ubiblock_set_param is wrong.

Given gcc errors if the struct is marked const __initdata, this commit
drops the const mark from it.

Reported-by: kbuild test robot <fengguang.wu at intel.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
---
 drivers/mtd/ubi/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index cea7d1c..4c970bc 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -156,7 +156,7 @@ static int __init ubiblock_set_param(const char *val,
 	return 0;
 }
 
-static const struct kernel_param_ops ubiblock_param_ops = {
+static struct kernel_param_ops ubiblock_param_ops __initdata = {
 	.set    = ubiblock_set_param,
 };
 module_param_cb(block, &ubiblock_param_ops, NULL, 0);
-- 
1.8.1.5




More information about the linux-mtd mailing list