diff mbox

[SCSI] aic94xx: silence a static checker warning

Message ID 20160502083458.GA19792@mwanda (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Dan Carpenter May 2, 2016, 8:34 a.m. UTC
"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>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);