Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754971AbbHDHmt (ORCPT ); Tue, 4 Aug 2015 03:42:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:46653 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbbHDHms convert rfc822-to-8bit (ORCPT ); Tue, 4 Aug 2015 03:42:48 -0400 From: Johannes Thumshirn To: Tomer Barletz Cc: jayamohan.kallickal@avagotech.com, minh.tran@avagotech.com, sony.john-n@avagotech.com, JBottomley@odin.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning References: <1438641357-25588-1-git-send-email-barletz@gmail.com> Date: Tue, 04 Aug 2015 09:42:45 +0200 In-Reply-To: <1438641357-25588-1-git-send-email-barletz@gmail.com> (Tomer Barletz's message of "Mon, 3 Aug 2015 15:35:57 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 49 Ok, it has cost me quite some time to figure out what "!length > 0" is actually doing, but looks ok to me. Tomer Barletz writes: > This fixes the following warning seen with GCC v5.1: > warning: logical not is only applied to the left hand side of > comparison [-Wlogical-not-parentheses]. > > Signed-off-by: Tomer Barletz > --- > drivers/scsi/be2iscsi/be_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c > index 7a6dbfb..ff8d40e 100644 > --- a/drivers/scsi/be2iscsi/be_main.c > +++ b/drivers/scsi/be2iscsi/be_main.c > @@ -3184,7 +3184,7 @@ be_sgl_create_contiguous(void *virtual_address, > { > WARN_ON(!virtual_address); > WARN_ON(!physical_address); > - WARN_ON(!length > 0); > + WARN_ON(0 == length); Please write WARN_ON(length == 0); > WARN_ON(!sgl); > > sgl->va = virtual_address; Given the above is swapped: Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/