linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [SCSI] aic94xx: silence a static checker warning
@ 2016-05-02  8:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-05-02  8:34 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Martin K. Petersen, linux-scsi, linux-kernel, kernel-janitors

"ddb" is a number between 0-64.  It can't ever be >= 0xFFFF.  But the
static checker complains that since we're capping the upper bound, we
may as well cap the lower bound and disallow negatives as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/aic94xx/aic94xx_dev.c b/drivers/scsi/aic94xx/aic94xx_dev.c
index 3307238..84eba3e 100644
--- a/drivers/scsi/aic94xx/aic94xx_dev.c
+++ b/drivers/scsi/aic94xx/aic94xx_dev.c
@@ -73,7 +73,7 @@ out:
 
 static void asd_free_ddb(struct asd_ha_struct *asd_ha, int ddb)
 {
-	if (!ddb || ddb >= 0xFFFF)
+	if (ddb <= 0 || ddb >= 0xFFFF)
 		return;
 	asd_ddbsite_write_byte(asd_ha, ddb, DDB_TYPE, DDB_TYPE_UNUSED);
 	CLEAR_DDB(ddb, asd_ha);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-02  8:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02  8:34 [patch] [SCSI] aic94xx: silence a static checker warning Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).