Received: by 2002:a5d:4890:0:0:0:0:0 with SMTP id g16csp861611wrq; Wed, 23 Oct 2019 06:05:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXWnI8knjGv5Hy0xgmClNEaImFZFTN2hubpROO+I8nqVBj5kcc0VikkYG0bxZEpNbbLV6I X-Received: by 2002:ac8:cc3:: with SMTP id o3mr9020633qti.239.1571835937279; Wed, 23 Oct 2019 06:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571835937; cv=none; d=google.com; s=arc-20160816; b=IEBcxI0xq0uDLo21ZWz5rFJATmfLXeg8CuBnbUwyndTdL2ejVSr+k7CLrxAdncGoh5 AlSl31ZOGWxhCuESoUwAoWf+73QtEXGNjI1ooT9wqstdBLIuTn5onHZ8b6ViGVYZJiIM RkzPDfDN+8zOlQFJOv9cMCPftaZCfAQlg4cwtp7EGdDO8W68fcFAc5OxRPhzKbk+87lO gbFEO+6ww8tfp8y6L5/oJ+JJUlih/BVnCI5eU7nXvQHdRPG52Njj6IhO/RYjR+K+6KSI pG55IaPJxZSjMvZ2eOw1X61w4dMQHDFrjk3G/Q6OAFxNAHB9VJ2jmUIa6QvTfyAYnW/f muQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :message-id:mime-version:references:in-reply-to:date:subject:to:from; bh=r/mNohtFbB7tmnBiIOYhHx0FQQXt0vIJm71En94jNsI=; b=hS6hY+/V3hmRpVbhAS+CA6jRSAdWZNqFe6grHZrVSen7fKmT8plGNI3ZKuuEEZ3ZNz suNzLyI/8YPi/o8mhR+uC1GOb/c62AFl3jCo0rsUD+t1cY3pPj6ZddErhBBEzSiVEmux O2Nt4zWW/r6R161Wp+VcHXXYOGxA7Nq1CijYA5R/b9EgPjcsFkywWZPGsRYpkRIgVZXJ TODz1Zvd2TD4taR37I1PNovAXYBUymNAmKu0hy1XAqqHpcdWeIxhY6ESZt85DAdhAPw9 rOnFMuWSGhsgEYRpACQpIU2/K97LW3yR8HGPGN9KcW9G0vrr7hDcI5rWuOy470l4WWGz uRTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h22si17426273qkl.164.2019.10.23.06.05.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Oct 2019 06:05:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:35498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNGKV-0001OE-Qn for alex.bennee@linaro.org; Wed, 23 Oct 2019 09:05:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42121) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNGKG-0001Io-Kb for qemu-arm@nongnu.org; Wed, 23 Oct 2019 09:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNGKE-0000JZ-TQ for qemu-arm@nongnu.org; Wed, 23 Oct 2019 09:05:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNGKE-0000Dm-KF for qemu-arm@nongnu.org; Wed, 23 Oct 2019 09:05:18 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x9ND47bw041993 for ; Wed, 23 Oct 2019 09:05:08 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vtp0u3wmv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Oct 2019 09:05:07 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 Oct 2019 14:05:05 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 23 Oct 2019 14:05:02 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x9ND51En47054936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Oct 2019 13:05:02 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D166E4C046; Wed, 23 Oct 2019 13:05:01 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C52C04C05A; Wed, 23 Oct 2019 13:05:01 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 23 Oct 2019 13:05:01 +0000 (GMT) Received: from yukon.kaod.org.com (sig-9-145-76-221.uk.ibm.com [9.145.76.221]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 20B6A2201D3; Wed, 23 Oct 2019 15:05:01 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PATCH 1/2] hw/gpio: Fix property accessors of the AST2600 GPIO 1.8V model Date: Wed, 23 Oct 2019 15:04:54 +0200 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191023130455.1347-1-clg@kaod.org> References: <20191023130455.1347-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 x-cbid: 19102313-0008-0000-0000-000003261D00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19102313-0009-0000-0000-00004A454C7F Message-Id: <20191023130455.1347-2-clg@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-10-23_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=796 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910230134 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x9ND47bw041993 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Joel Stanley , rashmica.g@gmail.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: GDoap1xbbgML 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 Fixes: 36d737ee82b2 ("hw/gpio: Add in AST2600 specific implementation") Signed-off-by: C=C3=A9dric Le Goater --- 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 196e47c26284..7acc5fa8e29a 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, Visito= r *v, const char *name, { int pin =3D 0xfff; bool level =3D true; - char group[3]; + char group[4]; AspeedGPIOState *s =3D ASPEED_GPIO(obj); int set_idx, group_idx =3D 0; =20 if (sscanf(name, "gpio%2[A-Z]%1d", group, &pin) !=3D 2) { /* 1.8V gpio */ - if (sscanf(name, "gpio%3s%1d", group, &pin) !=3D 2) { + if (sscanf(name, "gpio%3[18A-E]%1d", group, &pin) !=3D 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 =3D NULL; bool level; int pin =3D 0xfff; - char group[3]; + char group[4]; AspeedGPIOState *s =3D ASPEED_GPIO(obj); int set_idx, group_idx =3D 0; =20 @@ -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) !=3D 2) { /* 1.8V gpio */ - if (sscanf(name, "gpio%3s%1d", group, &pin) !=3D 2) { + if (sscanf(name, "gpio%3[18A-E]%1d", group, &pin) !=3D 2) { error_setg(errp, "%s: error reading %s", __func__, name); return; } --=20 2.21.0