From nobody Mon Nov 10 14:24:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1556667422; cv=none; d=zoho.com; s=zohoarc; b=Snh3wTcwvxQS0X5sx/2r9oX8fm1hOE15GX97bcwHrWnhLGZt3ppZFfKHtRZBwK7Y663zbhoKe1SGvqWWeXi6ZYUhNKhKUH9pmlT1l/wnJlIRPj8BTvX2Mi7rCLSKGEQycGp3FGtyqgeyOc9fHEzXZg8oP+4i+kjNLVqNAqj6//s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556667422; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xA3pbxiImBevyHhA8XuRcJTiyv2JoAMsxaYs6g7wvcc=; b=BRagaLW0XpdeA/f4g5dNx1cIkCpIqNdIsj+TGIpRfoyO8Z64kTg/BHYSWlRvSLAYEUeZqoADbmJoyCTa/tGdJjK73Bxsb7fHmbynZ5fT3TkW5lpQb8wJTmXkZGWhAmUXPlMpzZJuaU0xM3mFBgyotD1Bu7e25K8zMx+VST/Y5PI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556667422152976.0785294086223; Tue, 30 Apr 2019 16:37:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:55151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLcIv-0001P8-WC for importer@patchew.org; Tue, 30 Apr 2019 19:36:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLcGJ-0007Z9-Ml for qemu-devel@nongnu.org; Tue, 30 Apr 2019 19:34:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLcGI-0000Ho-Mz for qemu-devel@nongnu.org; Tue, 30 Apr 2019 19:34:11 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:58260) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLcAv-0005zQ-DT; Tue, 30 Apr 2019 19:28:37 -0400 Received: from mail-bl2nam02lp2058.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([104.47.38.58]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2019 07:28:35 +0800 Received: from DM6PR04MB4908.namprd04.prod.outlook.com (20.176.109.81) by DM6PR04MB5402.namprd04.prod.outlook.com (20.178.27.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.12; Tue, 30 Apr 2019 23:28:32 +0000 Received: from DM6PR04MB4908.namprd04.prod.outlook.com ([fe80::9ba:6028:ae27:7d2]) by DM6PR04MB4908.namprd04.prod.outlook.com ([fe80::9ba:6028:ae27:7d2%2]) with mapi id 15.20.1835.015; Tue, 30 Apr 2019 23:28:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556666918; x=1588202918; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=xA3pbxiImBevyHhA8XuRcJTiyv2JoAMsxaYs6g7wvcc=; b=ezu4kxmO0cX7PqfqJdVhDDG4vgDk/E/T9hlguhQjBnYS7A9n/q/s/m++ kImuZGd57Snm4BC8zL8f9u4hEpoP7o5bEmC3EoAx3w77IMhYK4deFYjeY HvBWxiZDn//zHiy8RqmjWWFI7/R1XHsoAQLT9Mlh+xCoT5KA7cZhSE5aQ 8vXGWlDK6LObt1JRqzgCHyVp2wtg9ie4Hgpqf//qB6Olq89+KjmShbn7w x4UOp3flQ39AUcIQg+pY/ZNDN8FKX+4Su9EAAwRc78fKMl1Rr1i4rOCBS CFffYlxY0BayPHYgO/qoyHz+VqaOOWdVt1J8D/dTiNSkSh4SK/5k80Idh Q==; X-IronPort-AV: E=Sophos;i="5.60,415,1549900800"; d="scan'208";a="108426282" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xA3pbxiImBevyHhA8XuRcJTiyv2JoAMsxaYs6g7wvcc=; b=gBrOXZ5HjdagQXqPzu/+QH265VaARcLfMo9+bfpbjX+cZJYfT1w2nQR52tlvoeoygmqh4friXEKHRk5jHqql5htUpUDE/56g2OxCHipNoeMTnPSS8lF5H7LHqWXqCLiYTr0bgUXv8pI8DcOsY/UGSupz2fTga83DmkcgQ7Tlb6A= From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v2 2/5] hw/usb/hcd-xhci: Fix GCC 9 build warning Thread-Index: AQHU/6xs8MY4iO8AKkC1lf7A3j3a/Q== Date: Tue, 30 Apr 2019 23:28:31 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR01CA0046.prod.exchangelabs.com (2603:10b6:a03:94::23) To DM6PR04MB4908.namprd04.prod.outlook.com (2603:10b6:5:19::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 87fd24ec-dd2a-4038-9822-08d6cdc38ec4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DM6PR04MB5402; x-ms-traffictypediagnostic: DM6PR04MB5402: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(366004)(376002)(136003)(396003)(39860400002)(346002)(199004)(189003)(72206003)(54906003)(6506007)(386003)(76176011)(446003)(14444005)(256004)(36756003)(4326008)(11346002)(102836004)(99286004)(66066001)(5660300002)(86362001)(44832011)(486006)(316002)(26005)(186003)(476003)(66476007)(2616005)(52116002)(66556008)(64756008)(73956011)(66946007)(66446008)(2906002)(6116002)(3846002)(50226002)(2351001)(6512007)(8936002)(6436002)(14454004)(71200400001)(71190400001)(6916009)(53936002)(6486002)(118296001)(81156014)(81166006)(2501003)(478600001)(68736007)(25786009)(5640700003)(8676002)(7736002)(305945005)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR04MB5402; H:DM6PR04MB4908.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uUDALsqKXjmNEDqZkLUIT8+Edm+/HKFHKbKgBXldkHJu1C18gi0ASg0nct15dyhb7xAu3NqUsU5ziQnQXx68pVEn7lWexG/wsw9XSXor6u1c3372OE9AhlupqeP9tp2e9lCSVZhAIU1FdXRQdDwsNIOybSYX1Khn3IUlLQEFda40rB892OICGTHEu/c+XFg9HApzRGZTpHAbEtP+yQTIE35hmwet1a/sXqpPliMD53/JxG3I7hi4EyF2hiGf6bgrE7FKAS5X/JNMuhDyQBJ383QCQUthKOQf1Xe8JB1qH/nBJpIVPswnsB2SSJFdW+vTUwP2qj/hyHR7w7Vh4wSqxAI9Jw2DfY5e2jcwGHtljz9rDp8UwOjbK5qt2pmHuZRrjiCnwQcJn6fRRUPpewUj1b248hMJfR4mDIggfwqKW8Y= Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87fd24ec-dd2a-4038-9822-08d6cdc38ec4 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 23:28:31.8700 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5402 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.153.144 Subject: [Qemu-devel] [PATCH v2 2/5] hw/usb/hcd-xhci: Fix GCC 9 build warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "qemu-trivial@nongnu.org" , "riku.voipio@iki.fi" , "laurent@vivier.eu" , Alistair Francis , "kraxel@redhat.com" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) Fix this build warning with GCC 9 on Fedora 30: hw/usb/hcd-xhci.c:3339:66: error: =E2=80=98%d=E2=80=99 directive output may= be truncated writing between 1 and 10 bytes into a region of size 5 [-Werr= or=3Dformat-truncation=3D] 3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d= ", i+1); | ^~ hw/usb/hcd-xhci.c:3339:54: note: directive argument in the range [1, 214748= 3647] 3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d= ", i+1); | ^~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:867, from /home/alistair/qemu/include/qemu/osdep.h:99, from hw/usb/hcd-xhci.c:21: /usr/include/bits/stdio2.h:67:10: note: =E2=80=98__builtin___snprintf_chk= =E2=80=99 output between 13 and 22 bytes into a destination of size 16 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - = 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ 68 | __bos (__s), __fmt, __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/hcd-xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index ec28bee319..2b061772b2 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3322,6 +3322,7 @@ static void usb_xhci_init(XHCIState *xhci) usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops, dev); =20 for (i =3D 0; i < usbports; i++) { + g_assert(i < MAX(MAXPORTS_2, MAXPORTS_3)); speedmask =3D 0; if (i < xhci->numports_2) { if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) { --=20 2.21.0