From: akpm@linux-foundation.org Subject: [patch for 2.6.29? 1/2] drivers/scsi: correct use of ! and & Date: Wed, 04 Mar 2009 12:12:16 -0800 Message-ID: <200903042012.n24KCHDT029998@imap1.linux-foundation.org> Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:46734 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756015AbZCDU0L (ORCPT ); Wed, 4 Mar 2009 15:26:11 -0500 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James.Bottomley@HansenPartnership.com Cc: linux-scsi@vger.kernel.org, akpm@linux-foundation.org, julia@diku.dk, robert.w.love@intel.com From: Julia Lawall !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 Cc: Robert Love Cc: James Bottomley Signed-off-by: Andrew Morton --- drivers/scsi/libfc/fc_exch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/scsi/libfc/fc_exch.c~drivers-scsi-correct-use-of-and drivers/scsi/libfc/fc_exch.c --- a/drivers/scsi/libfc/fc_exch.c~drivers-scsi-correct-use-of-and +++ a/drivers/scsi/libfc/fc_exch.c @@ -283,7 +283,7 @@ static void fc_exch_release(struct fc_ex 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); } } _