From 15fd94984f30701d6b3c45cebb0a9f2978dd1269 Mon Sep 17 00:00:00 2001 From: Philip Edelbrock Date: Wed, 9 Dec 1998 04:03:33 +0000 Subject: [PATCH] (Phil) Fixed a minor bug in smbus_access_i2c which caused an error on insertion ('memset' not resolved). Namely, I changed this line (near the very top of the function): char msgbuf0[33] = { command }; to: char msgbuf0[33]; [...] msgbuf0[0] = command; which should be equivelent (right?? ;'). git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@54 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/smbus.c | 3 ++- src/smbus.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/smbus.c b/kernel/smbus.c index c0fa8a51..d33a12cc 100644 --- a/kernel/smbus.c +++ b/kernel/smbus.c @@ -101,7 +101,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, need to use only one message; when reading, we need two. We initialize most things with sane defaults, to keep the code below somewhat simpler. */ - char msgbuf0[33] = { command }; + char msgbuf0[33]; char msgbuf1[33]; int num = read_write == SMBUS_READ?2:1; struct i2c_msg msg[2] = { { addr, 0, 1, msgbuf0 }, @@ -109,6 +109,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, }; int i; + msgbuf0[0] = command; switch(size) { case SMBUS_QUICK: msg[0].len = 0; diff --git a/src/smbus.c b/src/smbus.c index c0fa8a51..d33a12cc 100644 --- a/src/smbus.c +++ b/src/smbus.c @@ -101,7 +101,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, need to use only one message; when reading, we need two. We initialize most things with sane defaults, to keep the code below somewhat simpler. */ - char msgbuf0[33] = { command }; + char msgbuf0[33]; char msgbuf1[33]; int num = read_write == SMBUS_READ?2:1; struct i2c_msg msg[2] = { { addr, 0, 1, msgbuf0 }, @@ -109,6 +109,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, }; int i; + msgbuf0[0] = command; switch(size) { case SMBUS_QUICK: msg[0].len = 0;