mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Chan <mchan@broadcom.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: <prashant@broadcom.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tg3:Add error handling to the function tg3_test_loopback
Date: Thu, 16 Jul 2015 12:20:35 -0700	[thread overview]
Message-ID: <1437074435.3152.1.camel@LTIRV-MCHAN1.corp.ad.broadcom.com> (raw)
In-Reply-To: <1437074332.3152.0.camel@LTIRV-MCHAN1.corp.ad.broadcom.com>

On Thu, 2015-07-16 at 12:18 -0700, Michael Chan wrote: 
> On Thu, 2015-07-16 at 14:51 -0400, Nicholas Krause wrote: 
> > This adds proper error handling for if the calls to the function
> > tg3_phy_lpbk_set fail by returning -EIO by assigning the return
> > value to the variable err and if it equals anything other then
> > zero jumps to the goto label done as no other work can be handled
> > internally in the function tg3_test_loopback.
> > 
> > Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> 
> Acked-by: Michael Chan <mchan@broadcom.com>

Your indentation doesn't look right.  Other than that, it is ok.

> 
> > ---
> >  drivers/net/ethernet/broadcom/tg3.c | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index 73c934c..8584cb7 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -13625,8 +13625,10 @@ static int tg3_test_loopback(struct tg3 *tp, u64 *data, bool do_extlpbk)
> >  	    !tg3_flag(tp, USE_PHYLIB)) {
> >  		int i;
> >  
> > -		tg3_phy_lpbk_set(tp, 0, false);
> > -
> > +		err = tg3_phy_lpbk_set(tp, 0, false);
> > +			if (err)
> > +				goto done;
> > +
> >  		/* Wait for link */
> >  		for (i = 0; i < 100; i++) {
> >  			if (tr32(MAC_TX_STATUS) & TX_STATUS_LINK_UP)
> > @@ -13644,8 +13646,10 @@ static int tg3_test_loopback(struct tg3 *tp, u64 *data, bool do_extlpbk)
> >  			data[TG3_PHY_LOOPB_TEST] |= TG3_JMB_LOOPBACK_FAILED;
> >  
> >  		if (do_extlpbk) {
> > -			tg3_phy_lpbk_set(tp, 0, true);
> > -
> > +			err = tg3_phy_lpbk_set(tp, 0, true);
> > +
> > +				if (err)
> > +					goto done;
> >  			/* All link indications report up, but the hardware
> >  			 * isn't really ready for about 20 msec.  Double it
> >  			 * to be sure.
> 



      reply	other threads:[~2015-07-16 19:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1437072690-21048-1-git-send-email-xerofoify@gmail.com>
2015-07-16 19:18 ` Michael Chan
2015-07-16 19:20   ` Michael Chan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437074435.3152.1.camel@LTIRV-MCHAN1.corp.ad.broadcom.com \
    --to=mchan@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.com \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®