From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] mfd: max8925-i2c: Fix variable length array Sparse warning
Date: Thu, 28 Aug 2014 15:44:45 +0100 [thread overview]
Message-ID: <1409237086-21421-3-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1409237086-21421-1-git-send-email-lee.jones@linaro.org>
The largest byte size in use currently is 8. Fix array size to 9.
drivers/mfd/max8925-i2c.c:40:33:
warning: Variable length array is used
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/max8925-i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index ecbe78e..c880c89 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -37,7 +37,7 @@ static inline int max8925_read_device(struct i2c_client *i2c,
static inline int max8925_write_device(struct i2c_client *i2c,
int reg, int bytes, void *src)
{
- unsigned char buf[bytes + 1];
+ unsigned char buf[9];
int ret;
buf[0] = (unsigned char)reg;
--
1.9.1
next prev parent reply other threads:[~2014-08-28 14:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 14:44 [PATCH 1/4] mfd: 88pm860x-i2c: Purge unused functions Lee Jones
2014-08-28 14:44 ` [PATCH 2/4] mfd: 88pm860x-i2c: Fix variable length array Sparse warning Lee Jones
2014-08-28 14:44 ` Lee Jones [this message]
2014-08-28 14:44 ` [PATCH 4/4] mfd: stmpe: Rid variable length array Sparse warnings Lee Jones
2014-08-29 13:46 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409237086-21421-3-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).