netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make FC, FDDI, HIPPI and TR tristate
@ 2007-12-28 23:45 Jan Engelhardt
  2007-12-29  0:09 ` Adrian Bunk
  2007-12-29  8:18 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Engelhardt @ 2007-12-28 23:45 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev

Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
so they can be built as modules. This will allow CONFIG_LLC to be
built as a module too, overall reducing the core kernel image size.
    
$ size vmlinux.previous vmlinux
   text    data     bss     dec     hex filename
2805040  266008  380928 3451976  34ac48 vmlinux.previous
2794603  265620  380928 3441151  3481ff vmlinux

$ l vmlinux.previous vmlinux
-rwxr-xr-x 1 jengelh users 5154214 Dec 29 00:02 vmlinux.previous
-rwxr-xr-x 1 jengelh users 5135974 Dec 29 00:39 vmlinux

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index d9107e5..934f678 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2638,7 +2638,7 @@ config RIONET_RX_SIZE
 	default "128"
 
 config FDDI
-	bool "FDDI driver support"
+	tristate "FDDI driver support"
 	depends on (PCI || EISA || TC)
 	help
 	  Fiber Distributed Data Interface is a high speed local area network
@@ -2708,7 +2708,7 @@ config SKFP
 	  will be called skfp.  This is recommended.
 
 config HIPPI
-	bool "HIPPI driver support (EXPERIMENTAL)"
+	tristate "HIPPI driver support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && INET && PCI
 	help
 	  HIgh Performance Parallel Interface (HIPPI) is a 800Mbit/sec and
@@ -3009,7 +3009,7 @@ config SLIP_MODE_SLIP6
 	  over the async ports of a Camtec JNT Pad. If unsure, say N.
 
 config NET_FC
-	bool "Fibre Channel driver support"
+	tristate "Fibre Channel driver support"
 	depends on SCSI && PCI
 	help
 	  Fibre Channel is a high speed serial protocol mainly used to connect
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index e6b2e06..c4137b0 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -4,7 +4,7 @@
 
 # So far, we only have PCI, ISA, and MCA token ring devices
 menuconfig TR
-	bool "Token Ring driver support"
+	tristate "Token Ring driver support"
 	depends on NETDEVICES && !UML
 	depends on (PCI || ISA || MCA || CCW)
 	select LLC


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make FC, FDDI, HIPPI and TR tristate
  2007-12-28 23:45 [PATCH] Make FC, FDDI, HIPPI and TR tristate Jan Engelhardt
@ 2007-12-29  0:09 ` Adrian Bunk
  2007-12-29  0:41   ` Jan Engelhardt
  2007-12-29  8:18 ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2007-12-29  0:09 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: jgarzik, netdev

On Sat, Dec 29, 2007 at 12:45:12AM +0100, Jan Engelhardt wrote:
> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> so they can be built as modules. This will allow CONFIG_LLC to be
> built as a module too, overall reducing the core kernel image size.
>...

Just an example of code you have to fix if you do this:

$ grep -r "#ifdef CONFIG_TR" net/
net/802/sysctl_net_802.c:#ifdef CONFIG_TR
net/802/sysctl_net_802.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/atm/lec.c:#ifdef CONFIG_TR
net/ipv4/arp.c:#ifdef CONFIG_TR
net/llc/llc_output.c:#ifdef CONFIG_TR
net/sysctl_net.c:#ifdef CONFIG_TR
net/sysctl_net.c:#ifdef CONFIG_TR
$ 

For all variables you change to tristates you have to check every single 
#ifdef in C code in the kernel using this variable whether it needs to
be fixed when it's modular.

You also have to check all usages of these variables in Kconfig files, 
but my first impression is they are all OK.

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: [PATCH] Make FC, FDDI, HIPPI and TR tristate
  2007-12-29  0:09 ` Adrian Bunk
@ 2007-12-29  0:41   ` Jan Engelhardt
  2007-12-29  0:52     ` Adrian Bunk
  2007-12-29  8:19     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Engelhardt @ 2007-12-29  0:41 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: jgarzik, netdev


On Dec 29 2007 02:09, Adrian Bunk wrote:
>On Sat, Dec 29, 2007 at 12:45:12AM +0100, Jan Engelhardt wrote:
>> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
>> so they can be built as modules. This will allow CONFIG_LLC to be
>> built as a module too, overall reducing the core kernel image size.
>>...
>
>Just an example of code you have to fix if you do this:
>
>$ grep -r "#ifdef CONFIG_TR" net/

Ah, thank you for reminding me. For lec.c, would it be ok to do

#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
#	define WITH_TR 1
#endif

at the top and then do a s/CONFIG_TR/WITH_TR/? Just so that the #ifdef
lines do not explode in redundance.

>net/802/sysctl_net_802.c:#ifdef CONFIG_TR
>net/802/sysctl_net_802.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/atm/lec.c:#ifdef CONFIG_TR
>net/ipv4/arp.c:#ifdef CONFIG_TR
>net/llc/llc_output.c:#ifdef CONFIG_TR
>net/sysctl_net.c:#ifdef CONFIG_TR
>net/sysctl_net.c:#ifdef CONFIG_TR
>$ 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make FC, FDDI, HIPPI and TR tristate
  2007-12-29  0:41   ` Jan Engelhardt
@ 2007-12-29  0:52     ` Adrian Bunk
  2007-12-29  8:19     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2007-12-29  0:52 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: jgarzik, netdev

On Sat, Dec 29, 2007 at 01:41:23AM +0100, Jan Engelhardt wrote:
> 
> On Dec 29 2007 02:09, Adrian Bunk wrote:
> >On Sat, Dec 29, 2007 at 12:45:12AM +0100, Jan Engelhardt wrote:
> >> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> >> so they can be built as modules. This will allow CONFIG_LLC to be
> >> built as a module too, overall reducing the core kernel image size.
> >>...
> >
> >Just an example of code you have to fix if you do this:
> >
> >$ grep -r "#ifdef CONFIG_TR" net/
> 
> Ah, thank you for reminding me. For lec.c, would it be ok to do
> 
> #if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
> #	define WITH_TR 1
> #endif
>...

#if defined(CONFIG_TR) || (defined(CONFIG_TR_MODULE) && defined(MODULE))

Otherwise stuff like calling alloc_trdev() will cause build errors with 
CONFIG_TR=m, CONFIG_ATM_LANE=y.

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: [PATCH] Make FC, FDDI, HIPPI and TR tristate
  2007-12-28 23:45 [PATCH] Make FC, FDDI, HIPPI and TR tristate Jan Engelhardt
  2007-12-29  0:09 ` Adrian Bunk
@ 2007-12-29  8:18 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2007-12-29  8:18 UTC (permalink / raw)
  To: jengelh; +Cc: jgarzik, netdev

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Sat, 29 Dec 2007 00:45:12 +0100 (CET)

> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> so they can be built as modules. This will allow CONFIG_LLC to be
> built as a module too, overall reducing the core kernel image size.

You can't just do things like this.

Now, you have to go over the whole tree and look for
CONFIG_FOO ifdefs in this group and change them all into:

#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)

as we already do for things like IPV6.

This is most important in cases where these ifdefs
guard inclusion of members into core networking
datastructures, or control the definition of global
CPP macro defines, etc.

One particular instance that needs fixing is the
CONFIG_TR ifdef check in include/linux/netdevice.h

I'd like you to grep over the whole tree looking for
other potential problems like this before resubmitting
this patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make FC, FDDI, HIPPI and TR tristate
  2007-12-29  0:41   ` Jan Engelhardt
  2007-12-29  0:52     ` Adrian Bunk
@ 2007-12-29  8:19     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2007-12-29  8:19 UTC (permalink / raw)
  To: jengelh; +Cc: bunk, jgarzik, netdev

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Sat, 29 Dec 2007 01:41:23 +0100 (CET)

> 
> On Dec 29 2007 02:09, Adrian Bunk wrote:
> >On Sat, Dec 29, 2007 at 12:45:12AM +0100, Jan Engelhardt wrote:
> >> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> >> so they can be built as modules. This will allow CONFIG_LLC to be
> >> built as a module too, overall reducing the core kernel image size.
> >>...
> >
> >Just an example of code you have to fix if you do this:
> >
> >$ grep -r "#ifdef CONFIG_TR" net/
> 
> Ah, thank you for reminding me. For lec.c, would it be ok to do
> 
> #if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
> #	define WITH_TR 1
> #endif

We don't have a WITH_IPV6, we open code the ifdef check
all over the tree.

For consistency you should do that here too.  Please don't
add new ad-hoc macros to deal with situations like this.
If it's really a problem it should be handled globally in
the confines of the config system, not on a case-by-case
basis.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-29  8:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28 23:45 [PATCH] Make FC, FDDI, HIPPI and TR tristate Jan Engelhardt
2007-12-29  0:09 ` Adrian Bunk
2007-12-29  0:41   ` Jan Engelhardt
2007-12-29  0:52     ` Adrian Bunk
2007-12-29  8:19     ` David Miller
2007-12-29  8:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).