diff mbox series

[4/7] i2cdump: Remove dead code

Message ID 20210608173027.163e1eec@endymion
State New
Headers show
Series Rework block read support among i2cget and i2cdump | expand

Commit Message

Jean Delvare June 8, 2021, 3:30 p.m. UTC
Considering that we exit immediately if an error happens during a
block read, the code filling the remaining bytes with -1 so that
they will be displayed as "XX" is effectively dead code, so let's
remove it.

We might want to revisit the whole logic later, as there's in fact
little reason why block read errors would be fatal when all other
read errors are not. But I'd rather remove SMBus block support from
the tool before attempting to clean up the code.

Fixes: 7abc52d7792e ("Return the correct error code on I2C block read failure.")
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 tools/i2cdump.c |    3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

--- i2c-tools.orig/tools/i2cdump.c	2021-06-08 14:35:45.372892494 +0200
+++ i2c-tools/tools/i2cdump.c	2021-06-08 14:35:52.271986056 +0200
@@ -360,9 +360,6 @@  int main(int argc, char *argv[])
 				res = 256;
 			for (i = 0; i < res; i++)
 				block[i] = cblock[i];
-			if (size != I2C_SMBUS_BLOCK_DATA)
-				for (i = res; i < 256; i++)
-					block[i] = -1;
 		}
 
 		if (size == I2C_SMBUS_BYTE) {