* [net-next] vlan: change return type of vlan_proc_rem_dev
@ 2016-02-17 11:44 Zhang Shengju
2016-02-17 23:19 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Shengju @ 2016-02-17 11:44 UTC (permalink / raw)
To: kaber, netdev
Since function vlan_proc_rem_dev() will only return 0, it's better to
return void instead of int.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
net/8021q/vlanproc.c | 3 +--
net/8021q/vlanproc.h | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index ae63cf7..5f1446c 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -184,12 +184,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
/*
* Delete directory entry for VLAN device.
*/
-int vlan_proc_rem_dev(struct net_device *vlandev)
+void vlan_proc_rem_dev(struct net_device *vlandev)
{
/** NOTE: This will consume the memory pointed to by dent, it seems. */
proc_remove(vlan_dev_priv(vlandev)->dent);
vlan_dev_priv(vlandev)->dent = NULL;
- return 0;
}
/****** Proc filesystem entry points ****************************************/
diff --git a/net/8021q/vlanproc.h b/net/8021q/vlanproc.h
index 063f60a..a9d8734 100644
--- a/net/8021q/vlanproc.h
+++ b/net/8021q/vlanproc.h
@@ -5,7 +5,7 @@
struct net;
int vlan_proc_init(struct net *net);
-int vlan_proc_rem_dev(struct net_device *vlandev);
+void vlan_proc_rem_dev(struct net_device *vlandev);
int vlan_proc_add_dev(struct net_device *vlandev);
void vlan_proc_cleanup(struct net *net);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net-next] vlan: change return type of vlan_proc_rem_dev
2016-02-17 11:44 [net-next] vlan: change return type of vlan_proc_rem_dev Zhang Shengju
@ 2016-02-17 23:19 ` Cong Wang
0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2016-02-17 23:19 UTC (permalink / raw)
To: Zhang Shengju; +Cc: Patrick McHardy, Linux Kernel Network Developers
On Wed, Feb 17, 2016 at 3:44 AM, Zhang Shengju
<zhangshengju@cmss.chinamobile.com> wrote:
> Since function vlan_proc_rem_dev() will only return 0, it's better to
> return void instead of int.
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
> net/8021q/vlanproc.c | 3 +--
> net/8021q/vlanproc.h | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
> index ae63cf7..5f1446c 100644
> --- a/net/8021q/vlanproc.c
> +++ b/net/8021q/vlanproc.c
> @@ -184,12 +184,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
> /*
> * Delete directory entry for VLAN device.
> */
> -int vlan_proc_rem_dev(struct net_device *vlandev)
> +void vlan_proc_rem_dev(struct net_device *vlandev)
> {
> /** NOTE: This will consume the memory pointed to by dent, it seems. */
> proc_remove(vlan_dev_priv(vlandev)->dent);
> vlan_dev_priv(vlandev)->dent = NULL;
> - return 0;
> }
>
> /****** Proc filesystem entry points ****************************************/
> diff --git a/net/8021q/vlanproc.h b/net/8021q/vlanproc.h
> index 063f60a..a9d8734 100644
> --- a/net/8021q/vlanproc.h
> +++ b/net/8021q/vlanproc.h
> @@ -5,7 +5,7 @@
> struct net;
>
> int vlan_proc_init(struct net *net);
> -int vlan_proc_rem_dev(struct net_device *vlandev);
> +void vlan_proc_rem_dev(struct net_device *vlandev);
> int vlan_proc_add_dev(struct net_device *vlandev);
> void vlan_proc_cleanup(struct net *net);
You forget to change the !PROC_FS case:
#define vlan_proc_rem_dev(dev) ({(void)(dev), 0; })
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net-next] vlan: change return type of vlan_proc_rem_dev
@ 2016-02-18 2:25 张胜举
0 siblings, 0 replies; 3+ messages in thread
From: 张胜举 @ 2016-02-18 2:25 UTC (permalink / raw)
To: 'Cong Wang'
Cc: 'Patrick McHardy',
'Linux Kernel Network Developers'
>
> On Wed, Feb 17, 2016 at 3:44 AM, Zhang Shengju
> <zhangshengju@cmss.chinamobile.com> wrote:
> > Since function vlan_proc_rem_dev() will only return 0, it's better to
> > return void instead of int.
> >
> > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> > ---
> > net/8021q/vlanproc.c | 3 +--
> > net/8021q/vlanproc.h | 2 +-
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index
> > ae63cf7..5f1446c 100644
> > --- a/net/8021q/vlanproc.c
> > +++ b/net/8021q/vlanproc.c
> > @@ -184,12 +184,11 @@ int vlan_proc_add_dev(struct net_device
> > *vlandev)
> > /*
> > * Delete directory entry for VLAN device.
> > */
> > -int vlan_proc_rem_dev(struct net_device *vlandev)
> > +void vlan_proc_rem_dev(struct net_device *vlandev)
> > {
> > /** NOTE: This will consume the memory pointed to by dent, it seems.
> */
> > proc_remove(vlan_dev_priv(vlandev)->dent);
> > vlan_dev_priv(vlandev)->dent = NULL;
> > - return 0;
> > }
> >
> > /****** Proc filesystem entry points
> > ****************************************/
> > diff --git a/net/8021q/vlanproc.h b/net/8021q/vlanproc.h index
> > 063f60a..a9d8734 100644
> > --- a/net/8021q/vlanproc.h
> > +++ b/net/8021q/vlanproc.h
> > @@ -5,7 +5,7 @@
> > struct net;
> >
> > int vlan_proc_init(struct net *net);
> > -int vlan_proc_rem_dev(struct net_device *vlandev);
> > +void vlan_proc_rem_dev(struct net_device *vlandev);
> > int vlan_proc_add_dev(struct net_device *vlandev); void
> > vlan_proc_cleanup(struct net *net);
>
> You forget to change the !PROC_FS case:
>
> #define vlan_proc_rem_dev(dev) ({(void)(dev), 0; })
Thanks, I will add the missing part.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-18 2:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 11:44 [net-next] vlan: change return type of vlan_proc_rem_dev Zhang Shengju
2016-02-17 23:19 ` Cong Wang
-- strict thread matches above, loose matches on Subject: below --
2016-02-18 2:25 张胜举
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).