From nobody Wed May 15 07:49:36 2024 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=1556844900; cv=none; d=zoho.com; s=zohoarc; b=Bf8QbjmJwGPK7QNvXbbE7581QKj0eG23V2RGIdR6g1QKmLbHAj8vHi7TjPdvlPNWHR7XPronCy0FlseIou6BgcDvea91kbhNV6oHV11uD+iGiG/hqeNQyF4Y8Y30vpS70pl5OXG8YCa4V54/yrx7Vv9Jct6gfd/Q/zD9T0KWOLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556844900; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=ZKhTSOijUnR6VmyutTErzCTtb7/LzYl8Qi8s2fDKzrU=; b=TzdYdcXb/zl6xCv8zkPIttx777QtK/EbSrod4d8pndGQqeaJziOOMl9ysYVXtHhjedZWQFYFifGTJEUbg++/GQsDXn+ZZ3vt7p/nFCvLvQhWTdaHww7hWZamSU59vaZKEk5Zcy152/fal2ZBh3sciNVLia6jKmEJUeYKRn+1OPo= 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 1556844900172461.4726881141403; Thu, 2 May 2019 17:55:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:60630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMTX-0005v9-2q for importer@patchew.org; Thu, 02 May 2019 20:54:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHN-00046r-ED for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHJ-0006zo-LI for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:19 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:56396) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHE-0006v5-Ms; Thu, 02 May 2019 20:42:13 -0400 Received: from mail-dm3nam03lp2057.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([104.47.41.57]) by ob1.hgst.iphmx.com with ESMTP; 03 May 2019 08:42:06 +0800 Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5576.namprd04.prod.outlook.com (20.178.232.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Fri, 3 May 2019 00:42:04 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::4d89:bbf8:952c:3d66%5]) with mapi id 15.20.1856.008; Fri, 3 May 2019 00:42:04 +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=1556844132; x=1588380132; h=from:to:cc:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=ZKhTSOijUnR6VmyutTErzCTtb7/LzYl8Qi8s2fDKzrU=; b=ZKAUa5tfYNUxB94A+1Um/Kb2PtxxRZavpQvsJe8kT9GBn63wmXscqs2e hElShHuspHeYKYwdAzLSB74JtGmiypNk4SC304/XOh2ViZQV751xCoRp9 m9lsHiSqmnUw0D0DfsHj3wLpUAcvWgjgbnef/EiMfIwsZrQo0y/U4Bt+u JWB3FVkPkQRNxn0Lt2ZUpHTLWHvcSuIzleDoDGvu1aTL4D01f0z+Wh2qm FRTFk2T8n/81QIuPoyh6wl/Rbx6QUBqy/Or/PxgclGNtZcnYIy6vXNQ/J v4cl2C3zheaXz4d0KfhSyfwOk25JBDxF7X+gzOu+EYzye53+fUvjqMr0a g==; X-IronPort-AV: E=Sophos;i="5.60,423,1549900800"; d="scan'208";a="213338661" 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=ZKhTSOijUnR6VmyutTErzCTtb7/LzYl8Qi8s2fDKzrU=; b=PxCYlYXTMUeL1QpPZG9oLoFeNW8XGpQ19jVS0j1ojkGLAp2IS+iqCacCknvTO5TH1eWmG8P3K86GWNb8wyB1ldDecnjRdWY9SxVyM4i2Wv/1uYg1C+ZWUzsaRGjjVZVpS06Wh88w/x7MYv6W6iA95aX7F0CNuV3G1O3ouUka1F8= From: Alistair Francis To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v3] hw/usb/hcd-xhci: Fix GCC 9 build warning Thread-Index: AQHVAUkHBtSRVK/UMUaNnzlPvPu/Iw== Date: Fri, 3 May 2019 00:42:04 +0000 Message-ID: <20190503004021.13814-1-alistair.francis@wdc.com> 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: BYAPR06CA0043.namprd06.prod.outlook.com (2603:10b6:a03:14b::20) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) 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: b57f55b4-cae1-4b2f-cf69-08d6cf602998 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:BYAPR04MB5576; x-ms-traffictypediagnostic: BYAPR04MB5576: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-forefront-prvs: 0026334A56 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(366004)(136003)(376002)(346002)(199004)(189003)(7736002)(36756003)(3846002)(6436002)(6116002)(305945005)(72206003)(86362001)(52116002)(2501003)(68736007)(1076003)(66446008)(50226002)(2351001)(66556008)(66946007)(73956011)(6512007)(5660300002)(64756008)(66476007)(8676002)(81166006)(81156014)(14454004)(316002)(5640700003)(44832011)(8936002)(386003)(486006)(186003)(25786009)(6916009)(102836004)(6506007)(71200400001)(71190400001)(476003)(26005)(2616005)(66066001)(478600001)(2906002)(14444005)(256004)(53936002)(6486002)(4326008)(99286004)(54906003); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5576; H:BYAPR04MB4901.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: 1woYVFzKwHv7F4cozCOBT6ybcSxL4mCO8ANJw64XLn7rmLG/FgDn4ekn2AMusil9H2L3F13JSwc598lv2GcA0ILdovo6aEhVM5yqFBi9eM5f8MxXA+2VtSXrTbO2VlUv6wpmugsI6A6vb5cRgrhsqAjnOTFMWBZbqneva6vXICZHUpunyiNAlhkC/H/X7Im7MZ7nVqkpQ+vhWruMN54ApBA+cS/rn53tsJHA8LFuTHyBsFE0A5lkM9ruDgV6JDCBs9xvCIOB7ncA24bN8N/USbo6ejA9uDQNVutmoHhtFanYwHWzlg07O/toBzDZvgQkW5CGI7Agz76obkRU8mCvtmza6M1P70/9uaKshDhJFg6TBzbAoOVp9h3OCiNN+E0jJ0OghKXo/0jIx3WdBCy6+i7kLZbZBfgRLF0oKEpVq4w= Content-Type: text/plain; charset="utf-8" Content-ID: <75BE263937E2B44880102891AF9D9B29@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: b57f55b4-cae1-4b2f-cf69-08d6cf602998 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2019 00:42:04.5537 (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: BYAPR04MB5576 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.141.245 Subject: [Qemu-devel] [PATCH v3] 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" , =?utf-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= 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: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- This is the onl patch left if my original series "Fix some GCC 9 build warnings" that hasn't either been accepeted into a maintainers tree or fixed by someone else. hw/usb/hcd-xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index ec28bee319..a15b103b65 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3321,6 +3321,8 @@ static void usb_xhci_init(XHCIState *xhci) =20 usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops, dev); =20 + g_assert(usbports <=3D MAX(MAXPORTS_2, MAXPORTS_3)); + for (i =3D 0; i < usbports; i++) { speedmask =3D 0; if (i < xhci->numports_2) { --=20 2.21.0