linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: buffer: Remove redundant assignment to in_loc
@ 2021-05-17 10:11 Jiapeng Chong
  2021-05-17 13:22 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-05-17 10:11 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jiapeng Chong

Variable in_loc is being assigned a value from a calculation
however the assignment is never read, so this redundant assignment
can be removed.

Clean up the following clang-analyzer warning:

drivers/iio/industrialio-buffer.c:929:3: warning: Value stored to
'in_loc' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/iio/industrialio-buffer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 10923b4..fdd6234 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -926,7 +926,6 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
 		if (ret)
 			goto error_clear_mux_table;
 		out_loc += length;
-		in_loc += length;
 	}
 	buffer->demux_bounce = kzalloc(out_loc, GFP_KERNEL);
 	if (buffer->demux_bounce == NULL) {
-- 
1.8.3.1


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

* Re: [PATCH] iio: buffer: Remove redundant assignment to in_loc
  2021-05-17 10:11 [PATCH] iio: buffer: Remove redundant assignment to in_loc Jiapeng Chong
@ 2021-05-17 13:22 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-05-17 13:22 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: lars, linux-iio, linux-kernel

On Mon, 17 May 2021 18:11:57 +0800
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:

> Variable in_loc is being assigned a value from a calculation
> however the assignment is never read, so this redundant assignment
> can be removed.
> 
> Clean up the following clang-analyzer warning:
> 
> drivers/iio/industrialio-buffer.c:929:3: warning: Value stored to
> 'in_loc' is never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-buffer.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 10923b4..fdd6234 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -926,7 +926,6 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
>  		if (ret)
>  			goto error_clear_mux_table;
>  		out_loc += length;
> -		in_loc += length;
>  	}
>  	buffer->demux_bounce = kzalloc(out_loc, GFP_KERNEL);
>  	if (buffer->demux_bounce == NULL) {


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

end of thread, other threads:[~2021-05-17 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 10:11 [PATCH] iio: buffer: Remove redundant assignment to in_loc Jiapeng Chong
2021-05-17 13:22 ` Jonathan Cameron

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