diff mbox

[4/4] mfd: stmpe: Rid variable length array Sparse warnings

Message ID 1409237086-21421-4-git-send-email-lee.jones@linaro.org
State Accepted
Commit 7929fa7740f2a8cba6857aaa0f6513f81a0e3d88
Headers show

Commit Message

Lee Jones Aug. 28, 2014, 2:44 p.m. UTC
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(-)

Comments

Linus Walleij Aug. 29, 2014, 1:46 p.m. UTC | #1
On Thu, Aug 28, 2014 at 4:44 PM, Lee Jones <lee.jones@linaro.org> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

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;