mfd: 88pm860x-i2c: Fix variable length array Sparse warning
authorLee Jones <lee.jones@linaro.org>
Thu, 28 Aug 2014 09:51:26 +0000 (10:51 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 26 Sep 2014 07:15:45 +0000 (08:15 +0100)
drivers/mfd/88pm860x-i2c.c:125:33:
  warning: Variable length array is used.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/88pm860x-i2c.c

index 7063cfded6998bb8e8463a5fef71d6f2976b0e77..84e313107233ee8b1e86f0610be093eaa5e1637d 100644 (file)
@@ -122,7 +122,7 @@ static int read_device(struct i2c_client *i2c, int reg,
 static int write_device(struct i2c_client *i2c, int reg,
                        int bytes, void *src)
 {
-       unsigned char buf[bytes + 1];
+       unsigned char buf[2];
        struct i2c_adapter *adap = i2c->adapter;
        struct i2c_msg msg;
        int ret;