diff mbox series

iio: buffer: Remove redundant assignment to in_loc

Message ID 1621246317-62725-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series iio: buffer: Remove redundant assignment to in_loc | expand

Commit Message

Jiapeng Chong May 17, 2021, 10:11 a.m. UTC
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(-)

Comments

Jonathan Cameron May 17, 2021, 1:22 p.m. UTC | #1
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) {
diff mbox series

Patch

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