[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH 1/3] i2c_tools: cosmetic: Avoid hardcoded values
From: Olliver Schinagl <oliver+busybox () schinagl ! nl>
Date: 2023-05-12 8:35:23
Message-ID: 20230512083525.3164148-2-oliver+busybox () schinagl ! nl
[Download RAW message or body]
From: Olliver Schinagl <oliver@schinagl.nl>
There is a define that indicates the needed value properly, so we should
use that.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
miscutils/i2c_tools.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index da26f5e19..3a7df3b1e 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -252,7 +252,7 @@ static int32_t i2c_smbus_read_i2c_block_data(int fd, uint8_t cmd,
data.block[0] = len;
err = i2c_smbus_access(fd, I2C_SMBUS_READ, cmd,
- len == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN :
+ len == I2C_SMBUS_BLOCK_MAX ? I2C_SMBUS_I2C_BLOCK_BROKEN :
I2C_SMBUS_I2C_BLOCK_DATA, &data);
if (err < 0)
return err;
--
2.40.1
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic