netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] smsc75xx: don't call usbnet_resume if usbnet_suspend fails
@ 2012-11-28 17:57 Steve Glendinning
  2012-11-29  2:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Glendinning @ 2012-11-28 17:57 UTC (permalink / raw)
  To: netdev; +Cc: Steve Glendinning

If usbnet_suspend returns an error we don't want to call
usbnet_resume to clean up, but instead just return the error.

If usbnet_suspend *does* succeed, and we have a problem further
on, the desired behaviour is still to call usbnet_resume
to clean up before returning.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
---
 drivers/net/usb/smsc75xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 1823806..86d9249 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -1411,7 +1411,7 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
 	int ret;
 
 	ret = usbnet_suspend(intf, message);
-	check_warn_goto_done(ret, "usbnet_suspend error\n");
+	check_warn_return(ret, "usbnet_suspend error\n");
 
 	if (pdata->suspend_flags) {
 		netdev_warn(dev->net, "error during last resume\n");
-- 
1.7.10.4

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

* Re: [PATCH] smsc75xx: don't call usbnet_resume if usbnet_suspend fails
  2012-11-28 17:57 [PATCH] smsc75xx: don't call usbnet_resume if usbnet_suspend fails Steve Glendinning
@ 2012-11-29  2:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-11-29  2:03 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev

From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Wed, 28 Nov 2012 17:57:49 +0000

> If usbnet_suspend returns an error we don't want to call
> usbnet_resume to clean up, but instead just return the error.
> 
> If usbnet_suspend *does* succeed, and we have a problem further
> on, the desired behaviour is still to call usbnet_resume
> to clean up before returning.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>

Steve, can you do me a huge favor?

Get rid of these silly macros from this driver.

Any CPP macro that alters control flow is too evil to live.  And we've
worked tirelessly to remove every instance of such a macro from the
core networking interfaces, because they always lead to hard to
diagnose bugs.

THanks.

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

end of thread, other threads:[~2012-11-29  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 17:57 [PATCH] smsc75xx: don't call usbnet_resume if usbnet_suspend fails Steve Glendinning
2012-11-29  2:03 ` 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).