ipv4: compilation error fix with CONFIG_PROC_FS disabled
Subsystems (2)
RFC PATCH 1/1 ipv4: compilation error fix with CONFIG_PROC_FS disabled
Fixes compilation errors while compiling the kernel with CONFIG_PROC_FS disabled.
--- net/ipv4/fib_frontend.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/ipv4/fib_frontend.c +7 -0
@@ -1029,14 +1029,19 @@ static int __net_init fib_net_init(struc error =nl_fib_lookup_init (net);if (error <0 ) goto out_nlfl; +#ifdef CONFIG_PROC_FS error =fib_proc_init (net);if (error <0 ) goto out_proc; +#endif /* CONFIG_PROC_FS */ out:return error; +#ifdef CONFIG_PROC_FS out_proc:nl_fib_lookup_exit (net); +#endif /* CONFIG_PROC_FS */ + out_nlfl:ip_fib_net_exit (net); goto out;
@@ -1044,7 +1049,9 @@ out_nlfl: static void __net_exit fib_net_exit(struct net *net) { +#ifdef CONFIG_PROC_FS fib_proc_exit (net); +#endif /* CONFIG_PROC_FS */ nl_fib_lookup_exit (net);ip_fib_net_exit (net); }
Quoted 2 lines · Ram Pai
Fixes compilation errors while compiling the kernel with
CONFIG_PROC_FSdisabled.
Please always include the compiler message when fixing compilation warnings or errors.
This one is already fixed differently in current -git:
commit cc8274f50f2ad9a97a837451f63a0a3e65f7f490
Author: Li Zefan <[email protected]> Date: Tue Feb 5 02:54:16 2008 -0800
[IPV4]: Fix compile error building without CONFIG_FS_PROC
compile error building without CONFIG_FS_PROC:
net/ipv4/fib_frontend.c: In function 'fib_net_init':
net/ipv4/fib_frontend.c:1032: error: implicit declaration of function 'fib_proc_ init'
net/ipv4/fib_frontend.c: In function 'fib_net_exit':
net/ipv4/fib_frontend.c:1047: error: implicit declaration of function 'fib_proc_ exit'
include/net/ip_fib.h +8 -0
@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res)#ifdef CONFIG_PROC_FS extern int __net_init fib_proc_init (struct net *net); extern void __net_exit fib_proc_exit(struct net *net); +#else +static inline int fib_proc_init (struct net *net) +{ +return 0 ; +} +static inline void fib_proc_exit (struct net *net) +{ +}#endif #endif /* _NET_FIB_H */
David Miller
maintainerFrom: Ram Pai <[email protected]>
Date: Mon, 10 Mar 2008 11:11:03 -0700
Quoted 4 lines
Fixes compilation errors while compiling the kernel with
CONFIG_PROC_FSdisabled.Signed-off-by Ram Pai <[email protected]>
In the current tree, fib_proc_{init,exit}() are delcared as do-nothing inline functions in include/net/ip_fib.h
That was made by the following 2.6.25 changeset, which I'll queue up for 2.6.24-stable if necessary.
commit cc8274f50f2ad9a97a837451f63a0a3e65f7f490
Author: Li Zefan <[email protected]> Date: Tue Feb 5 02:54:16 2008 -0800
[IPV4]: Fix compile error building without CONFIG_FS_PROC
compile error building without CONFIG_FS_PROC:
net/ipv4/fib_frontend.c: In function 'fib_net_init':
net/ipv4/fib_frontend.c:1032: error: implicit declaration of function 'fib_proc_ init'
net/ipv4/fib_frontend.c: In function 'fib_net_exit':
net/ipv4/fib_frontend.c:1047: error: implicit declaration of function 'fib_proc_ exit'
include/net/ip_fib.h +8 -0
@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res)#ifdef CONFIG_PROC_FS extern int __net_init fib_proc_init (struct net *net); extern void __net_exit fib_proc_exit(struct net *net); +#else +static inline int fib_proc_init (struct net *net) +{ +return 0 ; +} +static inline void fib_proc_exit (struct net *net) +{ +}#endif #endif /* _NET_FIB_H */