public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: qlcnic: flash template based firmware reset recovery
Date: Thu, 30 Jan 2014 11:46:28 +0000	[thread overview]
Message-ID: <20140130114628.GA12734@elgon.mountain> (raw)

Hello Sony Chacko,

The patch 81d0aeb0a4ff: "qlcnic: flash template based firmware reset
recovery" from Jan 1, 2013, leads to the following static checker
warning:

	drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c:1756
		qlcnic_83xx_poll_list()
	warn: we tested 'delay' before and it was 'true'

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
  1745          delay = (long)p_hdr->delay;
  1746  
  1747          if (!delay) {
                    ^^^^^^

  1748                  for (i = 0; i < p_hdr->count; i++, entry++)
  1749                          qlcnic_83xx_poll_reg(p_dev, entry->arg1,
  1750                                               delay, poll->mask,
  1751                                               poll->status);
  1752          } else {
  1753                  for (i = 0; i < p_hdr->count; i++, entry++) {
  1754                          arg1 = entry->arg1;
  1755                          arg2 = entry->arg2;
  1756                          if (delay) {
                                    ^^^^^
"delay" is non-zero here.  No need to check again.

  1757                                  if (qlcnic_83xx_poll_reg(p_dev,
  1758                                                           arg1, delay,
  1759                                                           poll->mask,
  1760                                                           poll->status)){
  1761                                          QLCRD32(p_dev, arg1, &err);
  1762                                          if (err = -EIO)
  1763                                                  return;
  1764                                          QLCRD32(p_dev, arg2, &err);
  1765                                          if (err = -EIO)
  1766                                                  return;

But my main reason for emailing is that I'm confused by the error
handling here.  qlcnic_83xx_poll_reg() returns zero on success or
positive timeout or a negative error code.  How does calling
QLCRD32() fix the error?

  1767                                  }
  1768                          }
  1769                  }
  1770          }

regards,
dan carpenter


             reply	other threads:[~2014-01-30 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 11:46 Dan Carpenter [this message]
2014-01-30 20:47 ` qlcnic: flash template based firmware reset recovery Sony Chacko

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=20140130114628.GA12734@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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