All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James.Smart@Emulex.Com
Cc: linux-scsi@vger.kernel.org
Subject: re: [SCSI] lpfc 8.2.7 : Rework the worker thread
Date: Fri, 15 May 2015 12:49:34 +0300	[thread overview]
Message-ID: <20150515094934.GA23199@mwanda> (raw)

Hello James Smart,

The patch 5e9d9b827698: "[SCSI] lpfc 8.2.7 : Rework the worker
thread" from Jun 14, 2008, leads to the following static checker
warning:

	drivers/scsi/lpfc/lpfc_sli.c:9365 lpfc_sli_host_down()
	warn: test_bit() takes a bit number

drivers/scsi/lpfc/lpfc_sli.c
  9357          spin_lock_irqsave(&phba->hbalock, flags);
  9358          for (i = 0; i < psli->num_rings; i++) {
  9359                  pring = &psli->ring[i];
  9360                  prev_pring_flag = pring->flag;
  9361                  /* Only slow rings */
  9362                  if (pring->ringno == LPFC_ELS_RING) {
  9363                          pring->flag |= LPFC_DEFERRED_RING_EVENT;
  9364                          /* Set the lpfc data pending flag */
  9365                          set_bit(LPFC_DATA_READY, &phba->data_flags);

LPFC_DATA_READY is defined as:

#define LPFC_DATA_READY         (1<<0)

The intention seems to be that we use BIT(0) but because set_bit() has
a shift built in it is using BIT(1).  In other words:

Good:	set_bit(0, &phba->data_flags);
 Bad:   set_bit(BIT(0), &phba->data_flags);

This seems to be used consistently so I think it's fine, but static
checkers will complain.  I think this is the only ->data_flag that we
use so it doesn't matter (I haven't looked very hard at this code).

  9366                  }
  9367                  /*
  9368                   * Error everything on the txq since these iocbs have not been
  9369                   * given to the FW yet.
  9370                   */

regards,
dan carpenter

                 reply	other threads:[~2015-05-15  9:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20150515094934.GA23199@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=James.Smart@Emulex.Com \
    --cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.