diff mbox

scsi/be2iscsi: Fix logical-not-parentheses compilation warning

Message ID 1438712743-5821-1-git-send-email-barletz@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomer Barletz Aug. 4, 2015, 6:25 p.m. UTC
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 <barletz@gmail.com>
---
 drivers/scsi/be2iscsi/be_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Thumshirn Aug. 7, 2015, 9:44 a.m. UTC | #1
Tomer Barletz <barletz@gmail.com> 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 <barletz@gmail.com>
> ---
>  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..cf1908e 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(length == 0);
>  	WARN_ON(!sgl);
>  
>  	sgl->va = virtual_address;

Looks good.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff mbox

Patch

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 7a6dbfb..cf1908e 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(length == 0);
 	WARN_ON(!sgl);
 
 	sgl->va = virtual_address;