Skip to contentSkip to conversation

iio: buffer: Remove redundant assignment to in_loc

PATCH In review Jiapeng Chong 2 participants 2 messages May 17, 2021 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: buffer: Remove redundant assignment to in_loc

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

---
 drivers/iio/industrialio-buffer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/industrialio-buffer.c +0 -1
index 10923b4..fdd6234 100644
@@ -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) {
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 11 lines · On Mon, 17 May 2021 18:11:57 +0800 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].

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to poke at it.

Thanks,

Jonathan

Quoted 16 lines
---
 drivers/iio/industrialio-buffer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/industrialio-buffer.c +0 -1
index 10923b4..fdd6234 100644
@@ -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) {