summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/i2c_controller.c4
-rw-r--r--include/i2c.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/common/i2c_controller.c b/common/i2c_controller.c
index f29b40b251..d4ba03fd07 100644
--- a/common/i2c_controller.c
+++ b/common/i2c_controller.c
@@ -782,7 +782,7 @@ int i2c_read_sized_block(const int port,
i2c_lock(port, 1);
for (i = 0; i <= CONFIG_I2C_NACK_RETRY_COUNT; i++) {
- int data_length;
+ int data_length = 0;
/*
* Send device reg space offset, and read back block length.
@@ -794,7 +794,7 @@ int i2c_read_sized_block(const int port,
if (rv)
continue;
- if (max_len && block_length > max_len)
+ if (block_length > max_len)
data_length = max_len;
else
data_length = block_length;
diff --git a/include/i2c.h b/include/i2c.h
index 3ae1f60d97..c799b9599d 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -447,7 +447,6 @@ int i2c_unwedge(int port);
* [length_N] [byte_0] [byte_1] ... [byte_N]
*
* <len> : the max length of receiving buffer
- * <len> == 0 : buffer size > 255
*/
int i2c_read_sized_block(const int port,
const uint16_t addr_flags,
@@ -462,7 +461,6 @@ int i2c_read_sized_block(const int port,
* ascii, len should be at least N+1 to include the
* terminating 0. Similar to strlcpy, the terminating null is
* always written into the output buffer.
- * <len> == 0 : buffer size > 255
*/
int i2c_read_string(const int port,
const uint16_t addr_flags,