Date: Mon, 27 Jul 2009 18:14:48 +0200 (CEST) From: Julia Lawall To: linux-scsi@vger.kernel.org, James.Bottomley@HansenPartnership.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 8/12] drivers/scsi/fcoe: Correct redundant test The second test is more general than the first one. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; expression E; position p1,p2; @@ if (x == NULL || ...) { ... when forall return ...; } ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) ( *x == NULL | *x != NULL ) // Signed-off-by: Julia Lawall --- drivers/scsi/fcoe/libfcoe.c | 2 -- 1 file changed, 2 deletions(-) Index: b/drivers/scsi/fcoe/libfcoe.c =================================================================== --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c @@ -941,8 +941,6 @@ static void fcoe_ctlr_recv_clr_vlink(str u32 desc_mask; LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n"); - if (!fcf) - return; if (!fcf || !fc_host_port_id(lport->host)) return;