Skip to contentSkip to conversation

S3C: Remove unneeded __init symbols

PATCH New Nelson Castillo 2 participants 6 messages Jan 9, 2010 – Jan 13, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

Two functions defined with __init are also exported. Let's remove the __init symbols in order to avoid two warnings.

---

 arch/arm/plat-s3c/dev-nand.c |    2 +-
 arch/arm/plat-s3c24xx/devs.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c/dev-nand.c +1 -1
index 84808cc..a1137a7 100644
@@ -79,7 +79,7 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
 	return 0;
 }
 
-void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
+void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
 {
 	struct s3c2410_platform_nand *npd;
 	int size;
arch/arm/plat-s3c24xx/devs.c +1 -1
index 7f686a3..267f36a 100644
@@ -193,7 +193,7 @@ EXPORT_SYMBOL(s3c_device_ts);
 
 static struct s3c2410_ts_mach_info s3c2410ts_info;
 
-void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
+void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
 {
 	memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info));
 	s3c_device_ts.dev.platform_data = &s3c2410ts_info;
#1 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

Hi Nelson,

Quoted 2 lines · Nelson Castillo

Two functions defined with __init are also exported. Let's remove the __init symbols in order to avoid two warnings.

Can you quote the warnings please?

And I thought you agreed that "unneeded" for __init isn't optimal.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#2 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

2010/1/9 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hi Nelson,

Quoted 2 lines · Nelson Castillo

Two functions defined with __init are also exported. Let's remove the __init symbols in order to avoid two warnings.

Can you quote the warnings please?

Done. Patch attached.

Quoted 1 line

And I thought you agreed that "unneeded" for __init isn't optimal.

I also changed the subject. I don't know if it's optimal but it's
better now IMHO :-P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3c-remove-unneeded-init-annotations.patch
Type: text/x-diff
Size: 2176 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100113/c54a46ba/attachment.bin>

#3 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

Hello,

Quoted 31 lines · Nelson Castillo

2010/1/9 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hi Nelson,

Quoted 2 lines · Nelson Castillo

Two functions defined with __init are also exported. Let's remove the __init symbols in order to avoid two warnings.

Can you quote the warnings please?

Done. Patch attached.

Quoted 1 line

And I thought you agreed that "unneeded" for __init isn't optimal.

I also changed the subject. I don't know if it's optimal but it's better now IMHO :-P

From 0253f8900cba96ef1a5a8707ad1934f0a65f052a Mon Sep 17 00:00:00 2001
From: Nelson Castillo <[email protected]>
Date: Wed, 13 Jan 2010 09:33:59 -0500
Subject: [PATCH] S3C: Fix two warnings caused by __init annotations

The symbols s3c24xx_ts_set_platdata and s3c_nand_set_platdata are exported and annotated __init. Let's remove the __init annotations to avoid the following warnings:

WARNING: vmlinux.o(__ksymtab+0x428): Section mismatch in reference from the variable __ksymtab_s3c24xx_ts_set_platdata to the function .init.text:s3c24xx_ts_set_platdata()
The symbol s3c24xx_ts_set_platdata is exported and annotated __init Fix this by removing the __init annotation of s3c24xx_ts_set_platdata or drop the export.

Quoted 6 lines

WARNING: vmlinux.o(__ksymtab_gpl+0x40): Section mismatch in reference from the variable __ksymtab_s3c_nand_set_platdata to the function .init.text:s3c_nand_set_platdata()
The symbol s3c_nand_set_platdata is exported and annotated __init Fix this by removing the __init annotation of s3c_nand_set_platdata or drop the export.

	linux-2.6$ git grep -l -E 's3c(_nand|24xx_ts)_set_platdata'
	arch/arm/mach-s3c2410/include/mach/ts.h
	arch/arm/mach-s3c2410/mach-bast.c
	arch/arm/mach-s3c2410/mach-h1940.c
	arch/arm/mach-s3c2410/mach-qt2410.c
	arch/arm/mach-s3c2412/mach-jive.c
	arch/arm/mach-s3c2412/mach-vstms.c
	arch/arm/mach-s3c2440/mach-anubis.c
	arch/arm/mach-s3c2440/mach-at2440evb.c
	arch/arm/mach-s3c2440/mach-mini2440.c
	arch/arm/mach-s3c2440/mach-osiris.c
	arch/arm/mach-s3c2440/mach-rx3715.c
	arch/arm/mach-s3c2442/mach-gta02.c
	arch/arm/mach-s3c6410/mach-hmt.c
	arch/arm/plat-s3c/dev-nand.c
	arch/arm/plat-s3c/include/plat/nand.h
	arch/arm/plat-s3c24xx/common-smdk.c
	arch/arm/plat-s3c24xx/devs.c

This doesn't look to used in code that can be compiled as module. So isn't the more sensible fix to remove EXPORT_SYMBOL?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#4 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

2010/1/13 Uwe Kleine-K?nig <[email protected]>:

Quoted 60 lines

Hello,

Quoted 31 lines · Nelson Castillo

2010/1/9 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hi Nelson,

Quoted 2 lines · Nelson Castillo

Two functions defined with __init are also exported. Let's remove the __init symbols in order to avoid two warnings.

Can you quote the warnings please?

Done. Patch attached.

Quoted 1 line

And I thought you agreed that "unneeded" for __init isn't optimal.

I also changed the subject. I don't know if it's optimal but it's better now IMHO :-P

From 0253f8900cba96ef1a5a8707ad1934f0a65f052a Mon Sep 17 00:00:00 2001
From: Nelson Castillo <[email protected]>
Date: Wed, 13 Jan 2010 09:33:59 -0500
Subject: [PATCH] S3C: Fix two warnings caused by __init annotations

The symbols s3c24xx_ts_set_platdata and s3c_nand_set_platdata are exported and annotated __init. Let's remove the __init annotations to avoid the following warnings:

?WARNING: vmlinux.o(__ksymtab+0x428): Section mismatch in ?reference from the variable __ksymtab_s3c24xx_ts_set_platdata ?to the function .init.text:s3c24xx_ts_set_platdata()
?The symbol ?s3c24xx_ts_set_platdata is exported and annotated __init ?Fix this by ?removing the __init annotation of s3c24xx_ts_set_platdata ?or drop the ?export.

Quoted 6 lines

?WARNING: vmlinux.o(__ksymtab_gpl+0x40): Section mismatch in reference ?from the variable __ksymtab_s3c_nand_set_platdata to the function ?.init.text:s3c_nand_set_platdata()
?The symbol s3c_nand_set_platdata ?is exported and annotated __init ?Fix this by removing the __init ?annotation of s3c_nand_set_platdata ?or drop the export.

? ? ? ?linux-2.6$ git grep -l -E 's3c(_nand|24xx_ts)_set_platdata' ? ? ? ?arch/arm/mach-s3c2410/include/mach/ts.h
? ? ? ?arch/arm/mach-s3c2410/mach-bast.c
? ? ? ?arch/arm/mach-s3c2410/mach-h1940.c
? ? ? ?arch/arm/mach-s3c2410/mach-qt2410.c
? ? ? ?arch/arm/mach-s3c2412/mach-jive.c
? ? ? ?arch/arm/mach-s3c2412/mach-vstms.c
? ? ? ?arch/arm/mach-s3c2440/mach-anubis.c
? ? ? ?arch/arm/mach-s3c2440/mach-at2440evb.c
? ? ? ?arch/arm/mach-s3c2440/mach-mini2440.c
? ? ? ?arch/arm/mach-s3c2440/mach-osiris.c
? ? ? ?arch/arm/mach-s3c2440/mach-rx3715.c
? ? ? ?arch/arm/mach-s3c2442/mach-gta02.c
? ? ? ?arch/arm/mach-s3c6410/mach-hmt.c
? ? ? ?arch/arm/plat-s3c/dev-nand.c
? ? ? ?arch/arm/plat-s3c/include/plat/nand.h
? ? ? ?arch/arm/plat-s3c24xx/common-smdk.c
? ? ? ?arch/arm/plat-s3c24xx/devs.c

Quoted 2 lines

This doesn't look to used in code that can be compiled as module. ?So isn't the more sensible fix to remove EXPORT_SYMBOL?

Grr. Right. I think these functions are not to be used by modules.
New patch attached. Thanks.
Now the word "unneeded" can come back.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3c-remove-unneeded-exports.patch
Type: text/x-diff
Size: 2011 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100113/bf728bff/attachment.bin>

#5 lore raw

PATCH 1/1 S3C: Remove unneeded __init symbols

Hello,

Quoted 3 lines · Nelson Castillo

Grr. Right. I think these functions are not to be used by modules. New patch attached. Thanks.
Now the word "unneeded" can come back.

For-being-such-a-PITA-thanks-to: Uwe Kleine-K?nig <[email protected]>

or if you prefer it that way:

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |