aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2021-07-13 10:16:35 +0200
committerJean Delvare <jdelvare@suse.de>2021-07-13 10:16:35 +0200
commit230be0e72f2c8ca2d973218060e044c1dada1254 (patch)
tree073d54ec99f99423c5d4082bb5b1aae625435086
parent789af53206000faae4abdef078020954e56401a5 (diff)
downloadi2c-tools-230be0e72f2c8ca2d973218060e044c1dada1254.tar.gz
i2cdump: Remove dead code
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> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-rw-r--r--tools/i2cdump.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/i2cdump.c b/tools/i2cdump.c
index 70cecb9..7b291ea 100644
--- a/tools/i2cdump.c
+++ b/tools/i2cdump.c
@@ -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) {