public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* re: qlcnic: flash template based firmware reset recovery
@ 2014-01-30 11:46 Dan Carpenter
  2014-01-30 20:47 ` Sony Chacko
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-01-30 11:46 UTC (permalink / raw)
  To: kernel-janitors

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


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

end of thread, other threads:[~2014-01-30 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 11:46 qlcnic: flash template based firmware reset recovery Dan Carpenter
2014-01-30 20:47 ` Sony Chacko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox