aboutsummaryrefslogtreecommitdiff
path: root/miscutils/i2c_tools.c
diff options
context:
space:
mode:
authorGravatar Bartosz Golaszewski <bartekgola@gmail.com>2016-06-23 17:19:50 +0200
committerGravatar Denys Vlasenko <vda.linux@googlemail.com>2016-06-24 03:58:43 +0200
commit59f81976249a85cf02bd73c2395f018033069466 (patch)
tree85cefceec2a7edea58ebba3d6f2ea86d489e8685 /miscutils/i2c_tools.c
parent4d5acd2d4264d0a754d3d11c94825fd69d0c7837 (diff)
downloadbusybox-59f81976249a85cf02bd73c2395f018033069466.tar.gz
busybox-59f81976249a85cf02bd73c2395f018033069466.tar.bz2
i2cdump: don't use common_bufsiz1
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> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/i2c_tools.c')
-rw-r--r--miscutils/i2c_tools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index 57bb72ae7..7731466f7 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;