linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] mfd: stmpe: Rid variable length array Sparse warnings
Date: Thu, 28 Aug 2014 15:44:46 +0100	[thread overview]
Message-ID: <1409237086-21421-4-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1409237086-21421-1-git-send-email-lee.jones@linaro.org>

Numbers are generated by taking the largest currently used values.

drivers/mfd/stmpe.c:252:17:
  warning: Variable length array is used.
drivers/mfd/stmpe.c:857:16:
  warning: Variable length array is used.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/stmpe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 02a17c3..f9d46f0 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -249,7 +249,7 @@ int stmpe_set_altfunc(struct stmpe *stmpe, u32 pins, enum stmpe_block block)
 	int af_bits = variant->af_bits;
 	int numregs = DIV_ROUND_UP(stmpe->num_gpios * af_bits, 8);
 	int mask = (1 << af_bits) - 1;
-	u8 regs[numregs];
+	u8 regs[8];
 	int af, afperreg, ret;
 
 	if (!variant->get_altfunc)
@@ -854,7 +854,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
 	struct stmpe_variant_info *variant = stmpe->variant;
 	int num = DIV_ROUND_UP(variant->num_irqs, 8);
 	u8 israddr;
-	u8 isr[num];
+	u8 isr[3];
 	int ret;
 	int i;
 
-- 
1.9.1

  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 ` [PATCH 3/4] mfd: max8925-i2c: " Lee Jones
2014-08-28 14:44 ` Lee Jones [this message]
2014-08-29 13:46   ` [PATCH 4/4] mfd: stmpe: Rid variable length array Sparse warnings 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-4-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).