Bug 7708

Summary: unregister_netdev() should return unregister_netdevice() return code
Product: Networking Reporter: Benjamin Li (benjamin.li)
Component: OtherAssignee: Arnaldo Carvalho de Melo (acme)
Status: CLOSED CODE_FIX    
Severity: low    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.19.1 Subsystem:
Regression: --- Bisected commit-id:

Description Benjamin Li 2006-12-18 14:52:03 UTC
net/core/dev.c:unregister_netdev() function is a wrapper around
net/core/dev.c:unregister_netdevice().  The unregister_netdevice() function
returns a return code while unregister_netdev() currently does not.  For
completeness, we should pass the return code from unregister_netdevice() all the
way to the caller.  unregister_netdev() should not swallow the return code.
Comment 1 Andrew Morton 2006-12-18 15:16:49 UTC
On Mon, 18 Dec 2006 14:56:31 -0800
bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=7708
> 
>            Summary: unregister_netdev() should return unregister_netdevice()
>                     return code
>     Kernel Version: 2.6.19.1
>             Status: NEW
>           Severity: low
>              Owner: acme@conectiva.com.br
>          Submitter: benjamin.li@qlogic.com
> 
> 
> net/core/dev.c:unregister_netdev() function is a wrapper around
> net/core/dev.c:unregister_netdevice().  The unregister_netdevice() function
> returns a return code while unregister_netdev() currently does not.  For
> completeness, we should pass the return code from unregister_netdevice() all the
> way to the caller.  unregister_netdev() should not swallow the return code.
> 

Certainly there's some truth in that ;)

Is there some reason why you want to test the unregister_netdev() return
value?

Comment 2 Stephen Hemminger 2006-12-18 15:29:15 UTC
On Mon, 18 Dec 2006 15:21:11 -0800
Andrew Morton <akpm@osdl.org> wrote:

> On Mon, 18 Dec 2006 14:56:31 -0800
> bugme-daemon@bugzilla.kernel.org wrote:
> 
> > http://bugzilla.kernel.org/show_bug.cgi?id=7708
> > 
> >            Summary: unregister_netdev() should return unregister_netdevice()
> >                     return code
> >     Kernel Version: 2.6.19.1
> >             Status: NEW
> >           Severity: low
> >              Owner: acme@conectiva.com.br
> >          Submitter: benjamin.li@qlogic.com
> > 
> > 
> > net/core/dev.c:unregister_netdev() function is a wrapper around
> > net/core/dev.c:unregister_netdevice().  The unregister_netdevice() function
> > returns a return code while unregister_netdev() currently does not.  For
> > completeness, we should pass the return code from unregister_netdevice() all the
> > way to the caller.  unregister_netdev() should not swallow the return code.
> > 
> 
> Certainly there's some truth in that ;)
> 
> Is there some reason why you want to test the unregister_netdev() return
> value?
The only return value is -ENODEV, so I would vote for both just being void

Comment 3 Benjamin Li 2006-12-18 15:45:49 UTC
I wanted to test the return code for unregister_netdev() because one of the
first things the qla3xxx driver does when the driver is to be unloaded is call
unregister_netdev().  If the device unregistration fails, then with this extra
piece of information we can can bypass the some of the driver cleanup code. :)
Comment 4 Anonymous Emailer 2006-12-18 17:33:41 UTC
Reply-To: davem@davemloft.net

From: Stephen Hemminger <shemminger@osdl.org>
Date: Mon, 18 Dec 2006 15:50:57 -0800

> On Mon, 18 Dec 2006 15:21:11 -0800
> Andrew Morton <akpm@osdl.org> wrote:
> 
> > > net/core/dev.c:unregister_netdev() function is a wrapper around
> > > net/core/dev.c:unregister_netdevice().  The unregister_netdevice() function
> > > returns a return code while unregister_netdev() currently does not.  For
> > > completeness, we should pass the return code from unregister_netdevice() all the
> > > way to the caller.  unregister_netdev() should not swallow the return code.
> > > 
> > 
> > Certainly there's some truth in that ;)
> > 
> > Is there some reason why you want to test the unregister_netdev() return
> > value?
> The only return value is -ENODEV, so I would vote for both just being void

Me too.

FWIW, I think bug reports like this are a lot of back-and-forth waste
of time.  If it's important enough to someone, let them write a
god-damn patch for something so amazingly trivial.  With the bugzill
entry, you have to respond to it, change it's diapers, etc.

Comment 5 Dave Jones 2007-06-05 23:22:23 UTC
both functions now return void.