From 230be0e72f2c8ca2d973218060e044c1dada1254 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 13 Jul 2021 10:16:35 +0200 Subject: [PATCH] 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 Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- tools/i2cdump.c | 3 --- 1 file changed, 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) {