nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] dax: remove redundant assignment to variable rc
@ 2024-04-15 10:19 Colin Ian King
  2024-04-15 16:28 ` Alison Schofield
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin Ian King @ 2024-04-15 10:19 UTC (permalink / raw)
  To: Dan Williams, Vishal Verma, nvdimm, linux-cxl
  Cc: kernel-janitors, linux-kernel

The variable rc is being assigned an value and then is being re-assigned
a new value in the next statement. The assignment is redundant and can
be removed.

Cleans up clang scan build warning:
drivers/dax/bus.c:1207:2: warning: Value stored to 'rc' is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/dax/bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 797e1ebff299..f758afbf8f09 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -1204,7 +1204,6 @@ static ssize_t mapping_store(struct device *dev, struct device_attribute *attr,
 	if (rc)
 		return rc;
 
-	rc = -ENXIO;
 	rc = down_write_killable(&dax_region_rwsem);
 	if (rc)
 		return rc;
-- 
2.39.2


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

* Re: [PATCH][next] dax: remove redundant assignment to variable rc
  2024-04-15 10:19 [PATCH][next] dax: remove redundant assignment to variable rc Colin Ian King
@ 2024-04-15 16:28 ` Alison Schofield
  2024-04-15 17:55 ` Dave Jiang
  2024-04-16 23:02 ` Verma, Vishal L
  2 siblings, 0 replies; 4+ messages in thread
From: Alison Schofield @ 2024-04-15 16:28 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Dan Williams, Vishal Verma, nvdimm, linux-cxl, kernel-janitors,
	linux-kernel

On Mon, Apr 15, 2024 at 11:19:28AM +0100, Colin Ian King wrote:
> The variable rc is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
> 
> Cleans up clang scan build warning:
> drivers/dax/bus.c:1207:2: warning: Value stored to 'rc' is never
> read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Alison Schofield <alison.schofield@intel.com>

> ---
>  drivers/dax/bus.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 797e1ebff299..f758afbf8f09 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -1204,7 +1204,6 @@ static ssize_t mapping_store(struct device *dev, struct device_attribute *attr,
>  	if (rc)
>  		return rc;
>  
> -	rc = -ENXIO;
>  	rc = down_write_killable(&dax_region_rwsem);
>  	if (rc)
>  		return rc;
> -- 
> 2.39.2
> 
> 

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

* Re: [PATCH][next] dax: remove redundant assignment to variable rc
  2024-04-15 10:19 [PATCH][next] dax: remove redundant assignment to variable rc Colin Ian King
  2024-04-15 16:28 ` Alison Schofield
@ 2024-04-15 17:55 ` Dave Jiang
  2024-04-16 23:02 ` Verma, Vishal L
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2024-04-15 17:55 UTC (permalink / raw)
  To: Colin Ian King, Dan Williams, Vishal Verma, nvdimm, linux-cxl
  Cc: kernel-janitors, linux-kernel



On 4/15/24 3:19 AM, Colin Ian King wrote:
> The variable rc is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
> 
> Cleans up clang scan build warning:
> drivers/dax/bus.c:1207:2: warning: Value stored to 'rc' is never
> read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/dax/bus.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 797e1ebff299..f758afbf8f09 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -1204,7 +1204,6 @@ static ssize_t mapping_store(struct device *dev, struct device_attribute *attr,
>  	if (rc)
>  		return rc;
>  
> -	rc = -ENXIO;
>  	rc = down_write_killable(&dax_region_rwsem);
>  	if (rc)
>  		return rc;

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

* Re: [PATCH][next] dax: remove redundant assignment to variable rc
  2024-04-15 10:19 [PATCH][next] dax: remove redundant assignment to variable rc Colin Ian King
  2024-04-15 16:28 ` Alison Schofield
  2024-04-15 17:55 ` Dave Jiang
@ 2024-04-16 23:02 ` Verma, Vishal L
  2 siblings, 0 replies; 4+ messages in thread
From: Verma, Vishal L @ 2024-04-16 23:02 UTC (permalink / raw)
  To: Williams, Dan J, linux-cxl, colin.i.king, nvdimm
  Cc: kernel-janitors, linux-kernel

On Mon, 2024-04-15 at 11:19 +0100, Colin Ian King wrote:
> The variable rc is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
> 
> Cleans up clang scan build warning:
> drivers/dax/bus.c:1207:2: warning: Value stored to 'rc' is never
> read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

> ---
>  drivers/dax/bus.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 797e1ebff299..f758afbf8f09 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -1204,7 +1204,6 @@ static ssize_t mapping_store(struct device *dev, struct device_attribute *attr,
>  	if (rc)
>  		return rc;
>  
> -	rc = -ENXIO;
>  	rc = down_write_killable(&dax_region_rwsem);
>  	if (rc)
>  		return rc;


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

end of thread, other threads:[~2024-04-16 23:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15 10:19 [PATCH][next] dax: remove redundant assignment to variable rc Colin Ian King
2024-04-15 16:28 ` Alison Schofield
2024-04-15 17:55 ` Dave Jiang
2024-04-16 23:02 ` Verma, Vishal L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).