From: Julia Lawall Date: Wed, 4 Feb 2009 21:17:29 +0000 (+0100) Subject: [SCSI] libfc: Correct use of ! and & X-Git-Tag: firefly_0821_release~15216^2~68 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aa6cd29b72a5d8e6e5c8f536bc48693824ebfe09;p=firefly-linux-kernel-4.4.55.git [SCSI] libfc: Correct use of ! and & !ep->esb_stat is either 1 or 0, and the rightmost bit of ESB_ST_COMPLETE is always 0, making the result of !ep->esb_stat & ESB_ST_COMPLETE always 0. Thus parentheses around the argument to ! seem needed. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; constant C; @@ ( !E & !C | - !E & C + !(E & C) ) // Signed-off-by: Julia Lawall Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 505825b6124d..8a0c5c239e9c 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -281,7 +281,7 @@ static void fc_exch_release(struct fc_exch *ep) ep->destructor(&ep->seq, ep->arg); if (ep->lp->tt.exch_put) ep->lp->tt.exch_put(ep->lp, mp, ep->xid); - WARN_ON(!ep->esb_stat & ESB_ST_COMPLETE); + WARN_ON(!(ep->esb_stat & ESB_ST_COMPLETE)); mempool_free(ep, mp->ep_pool); } }