From 95cc7baa7f19e191b4790d144b7cbe47369cfe32 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 10 Aug 2010 18:01:13 -0700 Subject: drivers/scsi: remove unnecessary NULL test At the point where cmnd is initialized, it is tested for NULL, so it doesn't have to be tested again here. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld ... when != \(x = E\|&x\) * x == NULL // Signed-off-by: Julia Lawall Cc: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index a771416..1087977 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2817,7 +2817,6 @@ static void i91uSCBPost(u8 * host_mem, u8 * cblk_mem) } cmnd->result = cblk->tastat | (cblk->hastat << 16); - WARN_ON(cmnd == NULL); i91u_unmap_scb(host->pci_dev, cmnd); cmnd->scsi_done(cmnd); /* Notify system DONE */ initio_release_scb(host, cblk); /* Release SCB for current channel */ -- cgit v0.10.2