All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning
@ 2015-08-03 22:35 Tomer Barletz
  2015-08-04  7:42 ` Johannes Thumshirn
  0 siblings, 1 reply; 4+ messages in thread
From: Tomer Barletz @ 2015-08-03 22:35 UTC (permalink / raw)
  To: jayamohan.kallickal, minh.tran, sony.john-n, JBottomley
  Cc: linux-scsi, linux-kernel, Tomer Barletz

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..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);
 	WARN_ON(!sgl);
 
 	sgl->va = virtual_address;
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning
  2015-08-03 22:35 [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning Tomer Barletz
@ 2015-08-04  7:42 ` Johannes Thumshirn
  2015-08-04 18:25   ` Tomer Barletz
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2015-08-04  7:42 UTC (permalink / raw)
  To: Tomer Barletz
  Cc: jayamohan.kallickal, minh.tran, sony.john-n, JBottomley,
	linux-scsi, linux-kernel


Ok, it has cost me quite some time to figure out what "!length > 0" is
actually doing, but looks ok to me.


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..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 <jthumshirn@suse.de>

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning
  2015-08-04  7:42 ` Johannes Thumshirn
@ 2015-08-04 18:25   ` Tomer Barletz
  2015-08-07  9:44     ` Johannes Thumshirn
  0 siblings, 1 reply; 4+ messages in thread
From: Tomer Barletz @ 2015-08-04 18:25 UTC (permalink / raw)
  To: jayamohan.kallickal, minh.tran, sony.john-n, JBottomley
  Cc: linux-scsi, linux-kernel, Tomer Barletz

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;
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning
  2015-08-04 18:25   ` Tomer Barletz
@ 2015-08-07  9:44     ` Johannes Thumshirn
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2015-08-07  9:44 UTC (permalink / raw)
  To: Tomer Barletz
  Cc: jayamohan.kallickal, minh.tran, sony.john-n, JBottomley,
	linux-scsi, linux-kernel

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>

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-07  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03 22:35 [PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning Tomer Barletz
2015-08-04  7:42 ` Johannes Thumshirn
2015-08-04 18:25   ` Tomer Barletz
2015-08-07  9:44     ` Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.