public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Johannes Berg <johannes.berg@intel.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] scsi: pmcraid: fix minor sparse warnings
Date: Thu, 20 Apr 2017 19:54:48 +0200	[thread overview]
Message-ID: <20170420175549.3435196-4-arnd@arndb.de> (raw)
In-Reply-To: <20170420175549.3435196-1-arnd@arndb.de>

pmcraid_minor is only used in this one file and should be 'static' as suggested
by sparse:

drivers/scsi/pmcraid.c:80:1: warning: symbol 'pmcraid_minor' was not declared. Should it be static?

In Linux coding style, a literal '0' integer should not be used to represent
a NULL pointer:

drivers/scsi/pmcraid.c:348:29: warning: Using plain integer as NULL pointer
drivers/scsi/pmcraid.c:4824:49: warning: Using plain integer as NULL pointer

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/pmcraid.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 58c7511c5bd5..63298f017171 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -77,7 +77,7 @@ static atomic_t pmcraid_adapter_count = ATOMIC_INIT(0);
  */
 static unsigned int pmcraid_major;
 static struct class *pmcraid_class;
-DECLARE_BITMAP(pmcraid_minor, PMCRAID_MAX_ADAPTERS);
+static DECLARE_BITMAP(pmcraid_minor, PMCRAID_MAX_ADAPTERS);
 
 /*
  * Module parameters
@@ -345,7 +345,7 @@ static void pmcraid_init_cmdblk(struct pmcraid_cmd *cmd, int index)
 	cmd->scsi_cmd = NULL;
 	cmd->release = 0;
 	cmd->completion_req = 0;
-	cmd->sense_buffer = 0;
+	cmd->sense_buffer = NULL;
 	cmd->sense_buffer_dma = 0;
 	cmd->dma_handle = 0;
 	init_timer(&cmd->timer);
@@ -4824,7 +4824,7 @@ static int pmcraid_allocate_host_rrqs(struct pmcraid_instance *pinstance)
 					buffer_size,
 					&(pinstance->hrrq_start_bus_addr[i]));
 
-		if (pinstance->hrrq_start[i] == 0) {
+		if (!pinstance->hrrq_start[i]) {
 			pmcraid_err("pci_alloc failed for hrrq vector : %d\n",
 				    i);
 			pmcraid_release_host_rrqs(pinstance, i);
-- 
2.9.0

  parent reply	other threads:[~2017-04-20 17:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 17:54 [PATCH 1/4] scsi: pmcraid: use __iomem pointers for ioctl argument Arnd Bergmann
2017-04-20 17:54 ` [PATCH 2/4] scsi: pmcraid: fix lock imbalance in pmcraid_reset_reload() Arnd Bergmann
2017-04-23  8:36   ` Christoph Hellwig
2017-04-24 22:02     ` Martin K. Petersen
2017-04-20 17:54 ` [PATCH 3/4] scsi: pmcraid: fix endianess sparse annotations Arnd Bergmann
2017-04-23  8:38   ` Christoph Hellwig
2017-04-20 17:54 ` Arnd Bergmann [this message]
2017-04-23  8:39   ` [PATCH 4/4] scsi: pmcraid: fix minor sparse warnings Christoph Hellwig
2017-04-20 19:24 ` [PATCH 1/4] scsi: pmcraid: use __iomem pointers for ioctl argument Al Viro
2017-04-21 22:01   ` Arnd Bergmann
2017-04-21 22:02 ` [PATCH] scsi: pmcraid: use normal copy_from_user Arnd Bergmann
2017-04-23  8:28   ` Christoph Hellwig
2017-04-24 22:13   ` Martin K. Petersen

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=20170420175549.3435196-4-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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