* [PATCH] drivers: mtd: remove '__init' from phram_param_call() and ubi_mtd_param_parse()
@ 2013-09-02 9:51 Chen Gang
2013-09-02 10:30 ` Chen Gang
0 siblings, 1 reply; 2+ messages in thread
From: Chen Gang @ 2013-09-02 9:51 UTC (permalink / raw)
To: joern, dwmw2, dedekind1; +Cc: linux-mtd
phram_param_call() and ubi_mtd_param_parse() are used by
module_param_call(), usually, it need normal funcitons (no '__init'),
so recommend to remove '__init' from them.
The related warnings:
WARNING: drivers/mtd/devices/phram.o(.data+0xc): Section mismatch in reference from the variable ___param_ops_phram to the variable .init.text:_phram_param_call
The variable ___param_ops_phram references
the variable __init _phram_param_call
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: drivers/mtd/ubi/ubi.o(.data+0x1a4): Section mismatch in reference from the variable ___param_ops_mtd to the variable .init.text:_ubi_mtd_param_parse
The variable ___param_ops_mtd references
the variable __init _ubi_mtd_param_parse
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
drivers/mtd/devices/phram.c | 2 +-
drivers/mtd/ubi/build.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 67823de..bd7496a 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -264,7 +264,7 @@ static int __init phram_setup(const char *val)
return ret;
}
-static int __init phram_param_call(const char *val, struct kernel_param *kp)
+static int phram_param_call(const char *val, struct kernel_param *kp)
{
/*
* This function is always called before 'init_phram()', whether
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 315dcc6..c8b9493 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1382,7 +1382,7 @@ static int __init bytes_str_to_int(const char *str)
* This function returns zero in case of success and a negative error code in
* case of error.
*/
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
{
int i, len;
struct mtd_dev_param *p;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: mtd: remove '__init' from phram_param_call() and ubi_mtd_param_parse()
2013-09-02 9:51 [PATCH] drivers: mtd: remove '__init' from phram_param_call() and ubi_mtd_param_parse() Chen Gang
@ 2013-09-02 10:30 ` Chen Gang
0 siblings, 0 replies; 2+ messages in thread
From: Chen Gang @ 2013-09-02 10:30 UTC (permalink / raw)
To: joern, dwmw2, dedekind1; +Cc: linux-mtd
On 09/02/2013 05:51 PM, Chen Gang wrote:
> phram_param_call() and ubi_mtd_param_parse() are used by
> module_param_call(), usually, it need normal funcitons (no '__init'),
> so recommend to remove '__init' from them.
>
If remove '__init' from them, also need remove many other '__init' or
'__initdata' from another functions or variables.
Is this warning harmless ? (it not harmless, it seems we'd better to
keep them no touch)
Thanks.
> The related warnings:
>
> WARNING: drivers/mtd/devices/phram.o(.data+0xc): Section mismatch in reference from the variable ___param_ops_phram to the variable .init.text:_phram_param_call
> The variable ___param_ops_phram references
> the variable __init _phram_param_call
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
> WARNING: drivers/mtd/ubi/ubi.o(.data+0x1a4): Section mismatch in reference from the variable ___param_ops_mtd to the variable .init.text:_ubi_mtd_param_parse
> The variable ___param_ops_mtd references
> the variable __init _ubi_mtd_param_parse
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> drivers/mtd/devices/phram.c | 2 +-
> drivers/mtd/ubi/build.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
> index 67823de..bd7496a 100644
> --- a/drivers/mtd/devices/phram.c
> +++ b/drivers/mtd/devices/phram.c
> @@ -264,7 +264,7 @@ static int __init phram_setup(const char *val)
> return ret;
> }
>
> -static int __init phram_param_call(const char *val, struct kernel_param *kp)
> +static int phram_param_call(const char *val, struct kernel_param *kp)
> {
> /*
> * This function is always called before 'init_phram()', whether
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index 315dcc6..c8b9493 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1382,7 +1382,7 @@ static int __init bytes_str_to_int(const char *str)
> * This function returns zero in case of success and a negative error code in
> * case of error.
> */
> -static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
> +static int ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
> {
> int i, len;
> struct mtd_dev_param *p;
>
--
Chen Gang
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-02 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02 9:51 [PATCH] drivers: mtd: remove '__init' from phram_param_call() and ubi_mtd_param_parse() Chen Gang
2013-09-02 10:30 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox