* [PATCH 1/3] net: proc: fix build failed when procfs is not configured
@ 2013-02-19 10:43 Gao feng
2013-02-19 10:43 ` [PATCH 2/3] net: dev: fix build failed when procfs is disabled Gao feng
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Gao feng @ 2013-02-19 10:43 UTC (permalink / raw)
To: netdev; +Cc: davem, Gao feng
commit d4beaa66add8aebf83ab16d2fde4e4de8dac36df
"net: proc: change proc_net_fops_create to proc_create"
uses proc_create to replace proc_net_fops_create, when
CONFIG_PROC isn't configured, some build error will
occurs.
net/packet/af_packet.c: In function 'packet_net_init':
net/packet/af_packet.c:3831:48: error: 'packet_seq_fops' undeclared (first use in this function)
net/packet/af_packet.c:3831:48: note: each undeclared identifier is reported only once for each function it appears in
There may be other build fails like above,this patch
change proc_create from function to macros when CONFIG_PROC
is not configured,just like what proc_net_fops_create did
before this commit.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
include/linux/proc_fs.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 319f694..d0a1f2c 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -187,12 +187,9 @@ static inline void proc_flush_task(struct task_struct *task)
static inline struct proc_dir_entry *create_proc_entry(const char *name,
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
-static inline struct proc_dir_entry *proc_create(const char *name,
- umode_t mode, struct proc_dir_entry *parent,
- const struct file_operations *proc_fops)
-{
- return NULL;
-}
+
+#define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; })
+
static inline struct proc_dir_entry *proc_create_data(const char *name,
umode_t mode, struct proc_dir_entry *parent,
const struct file_operations *proc_fops, void *data)
--
1.7.11.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] net: dev: fix build failed when procfs is disabled
2013-02-19 10:43 [PATCH 1/3] net: proc: fix build failed when procfs is not configured Gao feng
@ 2013-02-19 10:43 ` Gao feng
2013-02-19 12:02 ` Cong Wang
2013-02-19 10:43 ` [PATCH 3/3] net: ipv4: fix waring -Wunused-variable Gao feng
2013-02-19 18:19 ` [PATCH 1/3] net: proc: fix build failed when procfs is not configured David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Gao feng @ 2013-02-19 10:43 UTC (permalink / raw)
To: netdev; +Cc: davem, Gao feng, Cong Wang
commit 900ff8c6321418dafa03c22e215cb9646a2541b9
"net: move procfs code to net/core/net-procfs.c"
missed define dev_mcast_init when CONFIG_PROC
isn't configured.
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
include/linux/netdevice.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f111b4f..91f6c7b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2693,8 +2693,10 @@ extern void net_disable_timestamp(void);
#ifdef CONFIG_PROC_FS
extern int __init dev_proc_init(void);
+extern void __init dev_mcast_init(void);
#else
#define dev_proc_init() 0
+#define dev_mcast_init() {}
#endif
extern int netdev_class_create_file(struct class_attribute *class_attr);
--
1.7.11.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] net: ipv4: fix waring -Wunused-variable
2013-02-19 10:43 [PATCH 1/3] net: proc: fix build failed when procfs is not configured Gao feng
2013-02-19 10:43 ` [PATCH 2/3] net: dev: fix build failed when procfs is disabled Gao feng
@ 2013-02-19 10:43 ` Gao feng
2013-02-19 18:19 ` David Miller
2013-02-19 18:19 ` [PATCH 1/3] net: proc: fix build failed when procfs is not configured David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Gao feng @ 2013-02-19 10:43 UTC (permalink / raw)
To: netdev; +Cc: davem, Gao feng
the vars ip_rt_gc_timeout is used only when
CONFIG_SYSCTL is selected.
move these vars into CONFIG_SYSCTL.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
net/ipv4/route.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 3bdd1b1..6e28514 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -117,15 +117,11 @@
#define RT_GC_TIMEOUT (300*HZ)
static int ip_rt_max_size;
-static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT;
-static int ip_rt_gc_interval __read_mostly = 60 * HZ;
-static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
static int ip_rt_redirect_number __read_mostly = 9;
static int ip_rt_redirect_load __read_mostly = HZ / 50;
static int ip_rt_redirect_silence __read_mostly = ((HZ / 50) << (9 + 1));
static int ip_rt_error_cost __read_mostly = HZ;
static int ip_rt_error_burst __read_mostly = 5 * HZ;
-static int ip_rt_gc_elasticity __read_mostly = 8;
static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ;
static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20;
static int ip_rt_min_advmss __read_mostly = 256;
@@ -2423,6 +2419,11 @@ void ip_rt_multicast_event(struct in_device *in_dev)
}
#ifdef CONFIG_SYSCTL
+static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT;
+static int ip_rt_gc_interval __read_mostly = 60 * HZ;
+static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
+static int ip_rt_gc_elasticity __read_mostly = 8;
+
static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
--
1.7.11.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] net: dev: fix build failed when procfs is disabled
2013-02-19 10:43 ` [PATCH 2/3] net: dev: fix build failed when procfs is disabled Gao feng
@ 2013-02-19 12:02 ` Cong Wang
0 siblings, 0 replies; 6+ messages in thread
From: Cong Wang @ 2013-02-19 12:02 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, davem
On 02/19/2013 06:43 PM, Gao feng wrote:
> commit 900ff8c6321418dafa03c22e215cb9646a2541b9
> "net: move procfs code to net/core/net-procfs.c"
> missed define dev_mcast_init when CONFIG_PROC
> isn't configured.
>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> include/linux/netdevice.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index f111b4f..91f6c7b 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2693,8 +2693,10 @@ extern void net_disable_timestamp(void);
>
> #ifdef CONFIG_PROC_FS
> extern int __init dev_proc_init(void);
> +extern void __init dev_mcast_init(void);
> #else
> #define dev_proc_init() 0
> +#define dev_mcast_init() {}
> #endif
>
> extern int netdev_class_create_file(struct class_attribute *class_attr);
>
Thanks for catching this!
I forgot to test !CONFIG_PROC_FS case again after grabbing the mcast piece.
I have a better fix, which moves dev_mcast_init() to dev_proc_init(),
will post it right now.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] net: proc: fix build failed when procfs is not configured
2013-02-19 10:43 [PATCH 1/3] net: proc: fix build failed when procfs is not configured Gao feng
2013-02-19 10:43 ` [PATCH 2/3] net: dev: fix build failed when procfs is disabled Gao feng
2013-02-19 10:43 ` [PATCH 3/3] net: ipv4: fix waring -Wunused-variable Gao feng
@ 2013-02-19 18:19 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-02-19 18:19 UTC (permalink / raw)
To: gaofeng; +Cc: netdev
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Tue, 19 Feb 2013 18:43:10 +0800
> commit d4beaa66add8aebf83ab16d2fde4e4de8dac36df
> "net: proc: change proc_net_fops_create to proc_create"
> uses proc_create to replace proc_net_fops_create, when
> CONFIG_PROC isn't configured, some build error will
> occurs.
>
> net/packet/af_packet.c: In function 'packet_net_init':
> net/packet/af_packet.c:3831:48: error: 'packet_seq_fops' undeclared (first use in this function)
> net/packet/af_packet.c:3831:48: note: each undeclared identifier is reported only once for each function it appears in
>
> There may be other build fails like above,this patch
> change proc_create from function to macros when CONFIG_PROC
> is not configured,just like what proc_net_fops_create did
> before this commit.
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] net: ipv4: fix waring -Wunused-variable
2013-02-19 10:43 ` [PATCH 3/3] net: ipv4: fix waring -Wunused-variable Gao feng
@ 2013-02-19 18:19 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-02-19 18:19 UTC (permalink / raw)
To: gaofeng; +Cc: netdev
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Tue, 19 Feb 2013 18:43:12 +0800
> the vars ip_rt_gc_timeout is used only when
> CONFIG_SYSCTL is selected.
>
> move these vars into CONFIG_SYSCTL.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-02-19 18:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19 10:43 [PATCH 1/3] net: proc: fix build failed when procfs is not configured Gao feng
2013-02-19 10:43 ` [PATCH 2/3] net: dev: fix build failed when procfs is disabled Gao feng
2013-02-19 12:02 ` Cong Wang
2013-02-19 10:43 ` [PATCH 3/3] net: ipv4: fix waring -Wunused-variable Gao feng
2013-02-19 18:19 ` David Miller
2013-02-19 18:19 ` [PATCH 1/3] net: proc: fix build failed when procfs is not configured 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).