From f57d6693e1ad994374927d7ab7b151bb28f0cb37 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 22 Dec 2013 15:32:29 +0100 Subject: pxa27x: Reduce size of keyboard matrix mapping The row and column values use only a very limited range (-1 ... 7), so a byte value is sufficient. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/hw/arm/pxa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index a4e1a66264..6db1ff344f 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -102,8 +102,8 @@ void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq); /* pxa2xx_keypad.c */ struct keymap { - int column; - int row; + int8_t column; + int8_t row; }; typedef struct PXA2xxKeyPadState PXA2xxKeyPadState; PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem, -- cgit v1.2.1 From 52975c313ee4b5ce2004c1ed3279272a55429ede Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 22 Dec 2013 15:22:57 +0100 Subject: pxa27x: Add 'const' attribute to keyboard maps The mapping is a hardware feature, so it is relatively constant. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/hw/arm/pxa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 6db1ff344f..7ca330a61f 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -109,8 +109,8 @@ typedef struct PXA2xxKeyPadState PXA2xxKeyPadState; PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem, hwaddr base, qemu_irq irq); -void pxa27x_register_keypad(PXA2xxKeyPadState *kp, struct keymap *map, - int size); +void pxa27x_register_keypad(PXA2xxKeyPadState *kp, + const struct keymap *map, int size); /* pxa2xx.c */ typedef struct PXA2xxI2CState PXA2xxI2CState; -- cgit v1.2.1