[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] hw/gpio/max7310: Remove impossible check
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 1/5] hw/gpio/max7310: Remove impossible check |
Date: |
Tue, 1 Sep 2020 12:40:39 +0200 |
The max7310_gpio_set() handler is static and only used by
qdev_init_gpio_in, initialized with 8 IRQs. The 'line'
argument can not be out of the [0-8[ range.
Remove the dead code.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/gpio/max7310.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c
index bebb4030d27..7f5de189acf 100644
--- a/hw/gpio/max7310.c
+++ b/hw/gpio/max7310.c
@@ -8,9 +8,7 @@
*/
#include "qemu/osdep.h"
-#include "hw/hw.h"
#include "hw/i2c/i2c.h"
-#include "hw/hw.h"
#include "hw/irq.h"
#include "migration/vmstate.h"
#include "qemu/module.h"
@@ -176,8 +174,6 @@ static const VMStateDescription vmstate_max7310 = {
static void max7310_gpio_set(void *opaque, int line, int level)
{
MAX7310State *s = (MAX7310State *) opaque;
- if (line >= ARRAY_SIZE(s->handler) || line < 0)
- hw_error("bad GPIO line");
if (level)
s->level |= s->direction & (1 << line);
--
2.26.2