* [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
@ 2006-04-13 16:22 Adrian Bunk
0 siblings, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2006-04-13 16:22 UTC (permalink / raw)
To: markus.lidel; +Cc: linux-kernel
static inline functions mustn't be exported.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c.old 2006-04-13 17:30:41.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c 2006-04-13 17:30:57.000000000 +0200
@@ -1243,7 +1243,6 @@
EXPORT_SYMBOL(i2o_cntxt_list_get_ptr);
#endif
EXPORT_SYMBOL(i2o_msg_get_wait);
-EXPORT_SYMBOL(i2o_msg_nop);
EXPORT_SYMBOL(i2o_find_iop);
EXPORT_SYMBOL(i2o_iop_find_device);
EXPORT_SYMBOL(i2o_event_register);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
@ 2006-04-18 15:06 Adrian Bunk
2006-04-19 6:06 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-04-18 15:06 UTC (permalink / raw)
To: Andrew Morton; +Cc: markus.lidel, linux-kernel
static inline functions mustn't be exported.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 13 Apr 2006
--- linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c.old 2006-04-13 17:30:41.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c 2006-04-13 17:30:57.000000000 +0200
@@ -1243,7 +1243,6 @@
EXPORT_SYMBOL(i2o_cntxt_list_get_ptr);
#endif
EXPORT_SYMBOL(i2o_msg_get_wait);
-EXPORT_SYMBOL(i2o_msg_nop);
EXPORT_SYMBOL(i2o_find_iop);
EXPORT_SYMBOL(i2o_iop_find_device);
EXPORT_SYMBOL(i2o_event_register);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
2006-04-18 15:06 Adrian Bunk
@ 2006-04-19 6:06 ` Andrew Morton
2006-04-19 8:33 ` Adrian Bunk
2006-04-20 23:17 ` Markus Lidel
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2006-04-19 6:06 UTC (permalink / raw)
To: Adrian Bunk; +Cc: markus.lidel, linux-kernel
Adrian Bunk <bunk@stusta.de> wrote:
>
> static inline functions mustn't be exported.
>
Actually, exports of static inlines work OK. The compiler will emit an
out-of-line copy to satisfy EXPORT_SYMBOL's reference and the module
namespace is separate from the compiler&linker's namespace.
Of course, things will screw up when we're using the compiler&linker
namespace (ie: the driver is statically linked).
> --- linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c.old 2006-04-13 17:30:41.000000000 +0200
> +++ linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c 2006-04-13 17:30:57.000000000 +0200
> @@ -1243,7 +1243,6 @@
> EXPORT_SYMBOL(i2o_cntxt_list_get_ptr);
> #endif
> EXPORT_SYMBOL(i2o_msg_get_wait);
> -EXPORT_SYMBOL(i2o_msg_nop);
> EXPORT_SYMBOL(i2o_find_iop);
> EXPORT_SYMBOL(i2o_iop_find_device);
> EXPORT_SYMBOL(i2o_event_register);
It depends whether Markus thinks this symbol is something which the driver
should be exporting. If so, we should uninline i2o_msg_nop(). But given
that it's in a header, nobody should be linking to it anyway...
(why on earth does i2o put semicolons after its function definitions?)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
2006-04-19 6:06 ` Andrew Morton
@ 2006-04-19 8:33 ` Adrian Bunk
2006-04-19 15:59 ` Patrick McHardy
2006-04-20 23:17 ` Markus Lidel
1 sibling, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-04-19 8:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: markus.lidel, linux-kernel, Patrick McHardy, davem
On Tue, Apr 18, 2006 at 11:06:00PM -0700, Andrew Morton wrote:
> Adrian Bunk <bunk@stusta.de> wrote:
> >
> > static inline functions mustn't be exported.
> >
>
> Actually, exports of static inlines work OK. The compiler will emit an
> out-of-line copy to satisfy EXPORT_SYMBOL's reference and the module
> namespace is separate from the compiler&linker's namespace.
>
> Of course, things will screw up when we're using the compiler&linker
> namespace (ie: the driver is statically linked).
>...
It even works with statically linked drivers.
It does work unless CONFIG_MODULES=n.
But this doesn't mean it's OK - exporting static code is wrong.
BTW:
It seems Patrick's recently merged patch to let the compiler help us
find such bugs (a1a8feed1743ec8d2af1dafa7c5321679f0a3e4f) isn't working.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
2006-04-19 8:33 ` Adrian Bunk
@ 2006-04-19 15:59 ` Patrick McHardy
0 siblings, 0 replies; 6+ messages in thread
From: Patrick McHardy @ 2006-04-19 15:59 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andrew Morton, markus.lidel, linux-kernel, davem
Adrian Bunk wrote:
> But this doesn't mean it's OK - exporting static code is wrong.
>
> BTW:
> It seems Patrick's recently merged patch to let the compiler help us
> find such bugs (a1a8feed1743ec8d2af1dafa7c5321679f0a3e4f) isn't working.
Indeed, something seems to be broken. I can't get it to throw warnings
anymore even for the H.323 case I initially tested it with, which is
strange because I did trial and error until I had something which I'm
100% sure did throw warnings. I'll look into it, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported
2006-04-19 6:06 ` Andrew Morton
2006-04-19 8:33 ` Adrian Bunk
@ 2006-04-20 23:17 ` Markus Lidel
1 sibling, 0 replies; 6+ messages in thread
From: Markus Lidel @ 2006-04-20 23:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: Adrian Bunk, linux-kernel
Hello,
Andrew Morton wrote:
> Adrian Bunk <bunk@stusta.de> wrote:
>> static inline functions mustn't be exported.
> Actually, exports of static inlines work OK. The compiler will emit an
> out-of-line copy to satisfy EXPORT_SYMBOL's reference and the module
> namespace is separate from the compiler&linker's namespace.
> Of course, things will screw up when we're using the compiler&linker
> namespace (ie: the driver is statically linked).
>> --- linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c.old 2006-04-13 17:30:41.000000000 +0200
>> +++ linux-2.6.17-rc1-mm2-full/drivers/message/i2o/iop.c 2006-04-13 17:30:57.000000000 +0200
>> @@ -1243,7 +1243,6 @@
>> EXPORT_SYMBOL(i2o_cntxt_list_get_ptr);
>> #endif
>> EXPORT_SYMBOL(i2o_msg_get_wait);
>> -EXPORT_SYMBOL(i2o_msg_nop);
>> EXPORT_SYMBOL(i2o_find_iop);
>> EXPORT_SYMBOL(i2o_iop_find_device);
>> EXPORT_SYMBOL(i2o_event_register);
> It depends whether Markus thinks this symbol is something which the driver
> should be exporting. If so, we should uninline i2o_msg_nop(). But given
> that it's in a header, nobody should be linking to it anyway...
> (why on earth does i2o put semicolons after its function definitions?)
OK, i could live with both versions... The EXPORT_SYMBOL was needed in
earlier version, but i forgot to remove it when i inlined the function
and put it into the header.
If someone thinks the inline is to expensive here, please let me know and
i will submit a patch to reverse it again.
Best regards,
Markus Lidel
------------------------------------------
Markus Lidel (Senior IT Consultant)
Shadow Connect GmbH
Carl-Reisch-Weg 12
D-86381 Krumbach
Germany
Phone: +49 82 82/99 51-0
Fax: +49 82 82/99 51-11
E-Mail: Markus.Lidel@shadowconnect.com
URL: http://www.shadowconnect.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-04-20 23:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-13 16:22 [2.6 patch] drivers/message/i2o/iop.c: static inline functions mustn't be exported Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2006-04-18 15:06 Adrian Bunk
2006-04-19 6:06 ` Andrew Morton
2006-04-19 8:33 ` Adrian Bunk
2006-04-19 15:59 ` Patrick McHardy
2006-04-20 23:17 ` Markus Lidel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox