[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/51] hw/gpio: Fix property accessors of the AST2600 GPIO 1.8V mo
From: |
Peter Maydell |
Subject: |
[PULL 01/51] hw/gpio: Fix property accessors of the AST2600 GPIO 1.8V model |
Date: |
Thu, 24 Oct 2019 17:26:34 +0100 |
From: Cédric Le Goater <address@hidden>
The property names of AST2600 GPIO 1.8V model are one character bigger
than the names of the other ASPEED GPIO model. Increase the string
buffer size by one and be more strict on the expected pattern of the
property name.
This fixes the QOM test of the ast2600-evb machine under :
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Cc: Rashmica Gupta <address@hidden>
Fixes: 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation")
Signed-off-by: Cédric Le Goater <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
hw/gpio/aspeed_gpio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
index 196e47c2628..7acc5fa8e29 100644
--- a/hw/gpio/aspeed_gpio.c
+++ b/hw/gpio/aspeed_gpio.c
@@ -733,13 +733,13 @@ static void aspeed_gpio_get_pin(Object *obj, Visitor *v,
const char *name,
{
int pin = 0xfff;
bool level = true;
- char group[3];
+ char group[4];
AspeedGPIOState *s = ASPEED_GPIO(obj);
int set_idx, group_idx = 0;
if (sscanf(name, "gpio%2[A-Z]%1d", group, &pin) != 2) {
/* 1.8V gpio */
- if (sscanf(name, "gpio%3s%1d", group, &pin) != 2) {
+ if (sscanf(name, "gpio%3[18A-E]%1d", group, &pin) != 2) {
error_setg(errp, "%s: error reading %s", __func__, name);
return;
}
@@ -760,7 +760,7 @@ static void aspeed_gpio_set_pin(Object *obj, Visitor *v,
const char *name,
Error *local_err = NULL;
bool level;
int pin = 0xfff;
- char group[3];
+ char group[4];
AspeedGPIOState *s = ASPEED_GPIO(obj);
int set_idx, group_idx = 0;
@@ -771,7 +771,7 @@ static void aspeed_gpio_set_pin(Object *obj, Visitor *v,
const char *name,
}
if (sscanf(name, "gpio%2[A-Z]%1d", group, &pin) != 2) {
/* 1.8V gpio */
- if (sscanf(name, "gpio%3s%1d", group, &pin) != 2) {
+ if (sscanf(name, "gpio%3[18A-E]%1d", group, &pin) != 2) {
error_setg(errp, "%s: error reading %s", __func__, name);
return;
}
--
2.20.1
- [PULL 00/51] target-arm queue, Peter Maydell, 2019/10/24
- [PULL 03/51] target/arm: Split out rebuild_hflags_common, Peter Maydell, 2019/10/24
- [PULL 02/51] aspeed: Add an AST2600 eval board, Peter Maydell, 2019/10/24
- [PULL 01/51] hw/gpio: Fix property accessors of the AST2600 GPIO 1.8V model,
Peter Maydell <=
- [PULL 05/51] target/arm: Split out rebuild_hflags_common_32, Peter Maydell, 2019/10/24
- [PULL 04/51] target/arm: Split out rebuild_hflags_a64, Peter Maydell, 2019/10/24
- [PULL 06/51] target/arm: Split arm_cpu_data_is_big_endian, Peter Maydell, 2019/10/24
- [PULL 08/51] target/arm: Reduce tests vs M-profile in cpu_get_tb_cpu_state, Peter Maydell, 2019/10/24
- [PULL 09/51] target/arm: Split out rebuild_hflags_a32, Peter Maydell, 2019/10/24
- [PULL 11/51] target/arm: Hoist XSCALE_CPAR, VECLEN, VECSTRIDE in cpu_get_tb_cpu_state, Peter Maydell, 2019/10/24
- [PULL 10/51] target/arm: Split out rebuild_hflags_aprofile, Peter Maydell, 2019/10/24
- [PULL 07/51] target/arm: Split out rebuild_hflags_m32, Peter Maydell, 2019/10/24
- [PULL 14/51] target/arm: Add arm_rebuild_hflags, Peter Maydell, 2019/10/24
- [PULL 15/51] target/arm: Split out arm_mmu_idx_el, Peter Maydell, 2019/10/24