netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] USB: mcs7830: return negative if auto negotiate fails
@ 2010-12-17 13:25 Dan Carpenter
  2010-12-23 18:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-12-17 13:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, netdev, kernel-janitors

The original code returns 0 on success and 1 on failure.  In fact, at
this point, "ret" is already either zero or a negative error code so
we can just return it directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index a6281e3..f3fe8e1 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -351,7 +351,7 @@ static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode)
 	if (!ret)
 		ret = mcs7830_write_phy(dev, MII_BMCR,
 				BMCR_ANENABLE | BMCR_ANRESTART	);
-	return ret < 0 ? : 0;
+	return ret;
 }
 
 

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

* Re: [patch] USB: mcs7830: return negative if auto negotiate fails
  2010-12-17 13:25 [patch] USB: mcs7830: return negative if auto negotiate fails Dan Carpenter
@ 2010-12-23 18:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-12-23 18:22 UTC (permalink / raw)
  To: error27; +Cc: gregkh, linux-usb, netdev, kernel-janitors

From: Dan Carpenter <error27@gmail.com>
Date: Fri, 17 Dec 2010 16:25:43 +0300

> The original code returns 0 on success and 1 on failure.  In fact, at
> this point, "ret" is already either zero or a negative error code so
> we can just return it directly.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Indeed, the USBNET ->bind() method, which this return value propagates
to, expects negative return values on error.

Applied, and queued up for -stable, thanks Dan.

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

end of thread, other threads:[~2010-12-23 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 13:25 [patch] USB: mcs7830: return negative if auto negotiate fails Dan Carpenter
2010-12-23 18:22 ` 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).