[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] i2cdump: don't use common_bufsiz1
From: Bartosz Golaszewski <bartekgola () gmail ! com>
Date: 2016-06-23 15:19:50
Message-ID: 1466695190-19051-1-git-send-email-bartekgola () gmail ! com
[Download RAW message or body]
Commit e6a2f4cc changed the way common_bufsiz1 works. Now it needs to
be initialized before using, but i2cdump wasn't updated by said patch.
Since the fact that we're using common_bufsiz1 here isn't obvious (no
G_INIT() macro, no other global variables), drop it and simply
allocate the integer array required for block reads on the stack.
Tested with i2c block read on a Lenovo Thinkpad laptop.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
---
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 57bb72a..7731466 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -908,7 +908,7 @@ int i2cdump_main(int argc UNUSED_PARAM, char **argv)
int bus_num, bus_addr, mode = I2C_SMBUS_BYTE_DATA, even = 0, pec = 0;
unsigned first = 0x00, last = 0xff, opts;
- int *block = (int *)bb_common_bufsiz1;
+ int block[I2CDUMP_NUM_REGS];
char *opt_r_str, *dash;
int fd, res;
--
2.7.4
_______________________________________________
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