All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
@ 2017-03-15 16:46 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-03-15 16:46 UTC (permalink / raw)
  To: Bradley Grove, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

buffer is a pointer to the static char array event_buffer and
therefore can never be null, so the check is redundant. Remove it.

Detected by CoverityScan, CID#1077556 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/esas2r/esas2r_log.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
index a82030a..65fdf22 100644
--- a/drivers/scsi/esas2r/esas2r_log.c
+++ b/drivers/scsi/esas2r/esas2r_log.c
@@ -130,11 +130,6 @@ static int esas2r_log_master(const long level,
 
 		spin_lock_irqsave(&event_buffer_lock, flags);
 
-		if (buffer == NULL) {
-			spin_unlock_irqrestore(&event_buffer_lock, flags);
-			return -1;
-		}
-
 		memset(buffer, 0, buflen);
 
 		/*
-- 
2.10.2

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

* [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
@ 2017-03-15 16:46 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-03-15 16:46 UTC (permalink / raw)
  To: Bradley Grove, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

buffer is a pointer to the static char array event_buffer and
therefore can never be null, so the check is redundant. Remove it.

Detected by CoverityScan, CID#1077556 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/esas2r/esas2r_log.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
index a82030a..65fdf22 100644
--- a/drivers/scsi/esas2r/esas2r_log.c
+++ b/drivers/scsi/esas2r/esas2r_log.c
@@ -130,11 +130,6 @@ static int esas2r_log_master(const long level,
 
 		spin_lock_irqsave(&event_buffer_lock, flags);
 
-		if (buffer = NULL) {
-			spin_unlock_irqrestore(&event_buffer_lock, flags);
-			return -1;
-		}
-
 		memset(buffer, 0, buflen);
 
 		/*
-- 
2.10.2


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

* Re: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
  2017-03-15 16:46 ` Colin King
@ 2017-03-16 21:09   ` Bradley Grove
  -1 siblings, 0 replies; 6+ messages in thread
From: Bradley Grove @ 2017-03-16 21:09 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

On 03/15/2017 12:46 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> buffer is a pointer to the static char array event_buffer and
> therefore can never be null, so the check is redundant. Remove it.
>
> Detected by CoverityScan, CID#1077556 ("Logically Dead Code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/scsi/esas2r/esas2r_log.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
> index a82030a..65fdf22 100644
> --- a/drivers/scsi/esas2r/esas2r_log.c
> +++ b/drivers/scsi/esas2r/esas2r_log.c
> @@ -130,11 +130,6 @@ static int esas2r_log_master(const long level,
>
>  		spin_lock_irqsave(&event_buffer_lock, flags);
>
> -		if (buffer == NULL) {
> -			spin_unlock_irqrestore(&event_buffer_lock, flags);
> -			return -1;
> -		}
> -
>  		memset(buffer, 0, buflen);
>
>  		/*
>

Thanks,

Acked-by: Bradley Grove <bgrove@attotech.com>



This electronic transmission and any attachments hereto are intended only for the use of the individual or entity to which it is addressed and may contain confidential information belonging to ATTO Technology, Inc. If you have reason to believe that you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this electronic transmission is strictly prohibited. If you have reason to believe that you have received this transmission in error, please notify ATTO immediately by return e-mail and delete and destroy this communication.   

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

* Re: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
@ 2017-03-16 21:09   ` Bradley Grove
  0 siblings, 0 replies; 6+ messages in thread
From: Bradley Grove @ 2017-03-16 21:09 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

On 03/15/2017 12:46 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> buffer is a pointer to the static char array event_buffer and
> therefore can never be null, so the check is redundant. Remove it.
>
> Detected by CoverityScan, CID#1077556 ("Logically Dead Code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/scsi/esas2r/esas2r_log.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
> index a82030a..65fdf22 100644
> --- a/drivers/scsi/esas2r/esas2r_log.c
> +++ b/drivers/scsi/esas2r/esas2r_log.c
> @@ -130,11 +130,6 @@ static int esas2r_log_master(const long level,
>
>  		spin_lock_irqsave(&event_buffer_lock, flags);
>
> -		if (buffer = NULL) {
> -			spin_unlock_irqrestore(&event_buffer_lock, flags);
> -			return -1;
> -		}
> -
>  		memset(buffer, 0, buflen);
>
>  		/*
>

Thanks,

Acked-by: Bradley Grove <bgrove@attotech.com>



This electronic transmission and any attachments hereto are intended only for the use of the individual or entity to which it is addressed and may contain confidential information belonging to ATTO Technology, Inc. If you have reason to believe that you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this electronic transmission is strictly prohibited. If you have reason to believe that you have received this transmission in error, please notify ATTO immediately by return e-mail and delete and destroy this communication.   

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

* Re: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
  2017-03-15 16:46 ` Colin King
@ 2017-03-16 23:50   ` Martin K. Petersen
  -1 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2017-03-16 23:50 UTC (permalink / raw)
  To: Colin King
  Cc: Bradley Grove, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> writes:

> buffer is a pointer to the static char array event_buffer and
> therefore can never be null, so the check is redundant. Remove it.

Applied to 4.12/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
@ 2017-03-16 23:50   ` Martin K. Petersen
  0 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2017-03-16 23:50 UTC (permalink / raw)
  To: Colin King
  Cc: Bradley Grove, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> writes:

> buffer is a pointer to the static char array event_buffer and
> therefore can never be null, so the check is redundant. Remove it.

Applied to 4.12/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-03-16 23:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 16:46 [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer Colin King
2017-03-15 16:46 ` Colin King
2017-03-16 21:09 ` Bradley Grove
2017-03-16 21:09   ` Bradley Grove
2017-03-16 23:50 ` Martin K. Petersen
2017-03-16 23:50   ` Martin K. Petersen

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.