From patchwork Tue Feb 13 04:38:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772258 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp89573wre; Mon, 12 Feb 2024 20:40:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV0mWwwmp78/GSYNlYwAlZ28yrNPYdS9JQQxJ8ppWQtiAGoIoEH3uWMDKnGKMBfV0OWIvy9nybpp0CmXBLZlC+o X-Google-Smtp-Source: AGHT+IHXWiqkD0DoehzbHFJWhvU471vNoOxKgah0eYbSHCy+qYHUt4NOqaR0zFnh7/Yak0Uiv5SI X-Received: by 2002:a05:620a:a49:b0:785:8b74:108c with SMTP id j9-20020a05620a0a4900b007858b74108cmr8697796qka.15.1707799204276; Mon, 12 Feb 2024 20:40:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707799204; cv=none; d=google.com; s=arc-20160816; b=XSzdzzsJbN47D/gQIkS8G+DFtwxnaiw3eGcgflkTkkK800Rx6cfEVynW06QKuZAQsM FGWCAWeoKi2F29+NgY6vUaOfkVUGTvPljrCLXR777t/UpdAOZAijXx+PF2mCHfAmwMKg r1Wou1UQymv+VmDJY4BgsAa+WztwycvLLkrLDboxeooC/GNG0QcbaS3nPn/VvkBy9/ZB AhBS1EafifZMtSYEzsur6nM2Hzft973hhemdqy4W0FyQvIgToXyPbwSR0ZB/gRG8oKOH zKo3yvP+w4xxh6kkT9IQURiJtq554icCf5eROx0wkJRH3692Oj8Etkau7upVg+xik86w yPRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o6pxcy83+qY+qqR1JfeBd83QWY3SHzfnMOli7CsxV1g=; fh=dL2J62bvOzNNndnrshua4qBrvcMdDcClHjAyDbkVXWU=; b=aaWM5yoTPpX511smYAiTaSXnPyIMg3+VvjsYCY/7IBUwj9rbDpTh6Xk+BehZvJswfk KJkqtfygoXPCqMuiLmQNWHA4pYmSBbmp5aAfR1u0OzU/Mp1cuisKJnT4V/YgjcLh4rcv WndngmXidt95iP18+TlDW6vUoEEd2F6orcftA5UaE4kcFM1rIVTqdd4oBnKbato5KBdU ikySgFr9NpVxdAboMvDHU/+7iOtEqM7WCAUl4JRlaEEXAA4DQot24BBWM60zVWetNWdP NHEU5/ZRgfQWPT8v6PBeh/OYrHweERlj4T7XES0G/CuvBnaS2YX4sgjOErC+MS8mN9OC jAhQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hl7fXCZX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCUcoQl2geglKeVeW5r1+fsLiF+Vu0yJkaPveaETlwb4C6L/ehc8wzCip+5JXXbGwkcFUzgLWtJ7yG/tqpkCWl1D Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q13-20020a05620a038d00b00785db64faa1si2488265qkm.672.2024.02.12.20.40.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2024 20:40:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hl7fXCZX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZkZi-0008V5-85; Mon, 12 Feb 2024 23:39:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZkZd-0008SZ-Jq for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:14 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZkZa-0005zc-F9 for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:11 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d107900457so3886111fa.1 for ; Mon, 12 Feb 2024 20:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707799147; x=1708403947; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o6pxcy83+qY+qqR1JfeBd83QWY3SHzfnMOli7CsxV1g=; b=hl7fXCZXi7maccqm24r5IDkfVPS5OZN0PVEKoLkD30rvSZLDxf4AKtd5oFNqs+wjEP 5zxqrS7fQdG3KjO4FLfL0Qsn1fcpnwx55ABx/qUuHw8A/WVzF0YfnvkN066J3Fxf0RT3 ewptUWYlfPB8Rs4VMhqk2mIrYolr5hfCC0rByUggs37qoTI7+obrjTQDlBBG85bhqFEr 1G37k80v1J7uRezQdcE+2ErRTGhm1GSfu4Mn4oepfv6dNSs+3qVT+YGFt7HO/lXLyc5E 7AfNm8UiMTTj4ZBslWM2ZQGL7wTbauvWc7cuPSdphW6oqjlBCx3l58At236ZtARSGlWp auFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707799147; x=1708403947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o6pxcy83+qY+qqR1JfeBd83QWY3SHzfnMOli7CsxV1g=; b=kBGkgRva3yf9nGme/hcldu65fQjSICJKdB5B7fYD8NLLYnEwY4vq69U4V84wrHT9ST IY7tgNtJp2Z1tW7yipMBww/J7kz3d+35G9nG8Zu0CUGA5mHqz/NeayeTRZI1ZtGW47iM azde3zLrEzZ+h1yDhgcSooRqPPiXNUaxDH3AnEqkAlM2l7i8UJi7vge5h5VnqNJProo0 nl23aWSbYhUfIzVUXpDp1jop7XSTt/aLKOFQXl+kACM9cxHETzCNjBxNkZmCOGWZGqQd eG9rh7Ha2wZHSmz5+R99CSebgq4IiRkkqEv46FxMh7fOSikmrTZfrpuODN1KnmnccDzW kAOw== X-Gm-Message-State: AOJu0Yy/9wlUk91tMf8BB0wvqGopvt0ZEkfQepW/PgaM6HM520mvikkJ +wC5tHAKYOnZD+MGLEEW/ABcrmXZTBZZHUZboh+/7X9FqI7vN0UHM7A/xaqxZ+gW0o+wXj2uBhd 9 X-Received: by 2002:a05:651c:a12:b0:2d1:749:c85f with SMTP id k18-20020a05651c0a1200b002d10749c85fmr526820ljq.47.1707799146683; Mon, 12 Feb 2024 20:39:06 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWelYw+K+czkwcdHJjSKFRz8AzTHcxEzN5x7MjPxiZwA4JRoNdiQl8OQR9ApRI2okuGK/u6ji/kRMcoZak3PUW57zQPM0+ZsIzpNzAhMJP2kZ7wdzk= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id em8-20020a056402364800b00561740859b3sm3096177edb.19.2024.02.12.20.39.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Feb 2024 20:39:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Gerd Hoffmann , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] hw/usb: Style cleanup Date: Tue, 13 Feb 2024 05:38:57 +0100 Message-ID: <20240213043859.61019-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213043859.61019-1-philmd@linaro.org> References: <20240213043859.61019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We are going to modify these lines, fix their style in order to avoid checkpatch.pl warning. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-ehci.c | 3 ++- hw/usb/hcd-uhci.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 870c72cb59..98a2860069 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1086,8 +1086,9 @@ static void ehci_opreg_write(void *ptr, hwaddr addr, case CONFIGFLAG: val &= 0x1; if (val) { - for(i = 0; i < NB_PORTS; i++) + for (i = 0; i < NB_PORTS; i++) { handle_port_owner_write(s, i, 0); + } } break; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 7d3c026dae..b95b47f6a4 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -457,8 +457,9 @@ static void uhci_port_write(void *opaque, hwaddr addr, int n; n = (addr >> 1) & 7; - if (n >= NB_PORTS) + if (n >= NB_PORTS) { return; + } port = &s->ports[n]; dev = port->port.dev; if (dev && dev->attached) { @@ -513,8 +514,9 @@ static uint64_t uhci_port_read(void *opaque, hwaddr addr, unsigned size) UHCIPort *port; int n; n = (addr >> 1) & 7; - if (n >= NB_PORTS) + if (n >= NB_PORTS) { goto read_default; + } port = &s->ports[n]; val = port->ctrl; } From patchwork Tue Feb 13 04:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772260 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp89653wre; Mon, 12 Feb 2024 20:40:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUO9+2mDsXYOlN03hPsRAr3Kv9I65yt2p3PEFUwAhTwkqWuF5whKNlbEpvto9dPIwz9Qz9ztLXP0dlq4+0hMQ8t X-Google-Smtp-Source: AGHT+IFLeqjcLTDBgJYkYHsjmV0exDcv9o6UWkcaZwR49eRSuTE2oRMNTxFBYDzqWUwPMg1xqSrV X-Received: by 2002:a05:620a:40cd:b0:785:98a0:6a3b with SMTP id g13-20020a05620a40cd00b0078598a06a3bmr9685587qko.42.1707799222056; Mon, 12 Feb 2024 20:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707799222; cv=none; d=google.com; s=arc-20160816; b=WYGJ3ZJ1xjs2mSlPCHRyogVh/Dx2WZ2/kdG1m2VKssVdwLVvktoRnPWEq8CHHqcJa8 KPm+9VFwwZS23Qg7EBi0KjSnHyrixNxCEhTxUxfK++YpxX2TjSUgam7VgfK3EJx+aSP+ AdSbNEXrwujrXouFaX2nGIOImr6aVbvryWRV0TBih4ZHLu6KCS1b5eQa9WJDDJlMSYWT DyWGRr2qe75+PyMgeoWMnt/sTJQpbrn+gFwVYjbQv/c4SWqVbV53Ev6Dp82Aw2wExtQV MtJkL90QBRIoFEAQAzdVmR1MQNgFoJBlSvXkAVOF5hIqGUDPCEGbqWVH0WgO5iWnvPq6 mrFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vj8qKfoHRQQSQjKf28SMVg7GGjhkAsn0wq6WSyRxVjw=; fh=9fdq2fhEPU3uJuAD8Z0fyU/R2OXlJIr+nsUbg+7112k=; b=xrtQCZYbjzaeBX0ZXqxh+/HZEWbJ09z8w0jLw26vKgntubVYrwlwuLELsGJvxuqQUc SBKICbPFqLBOlpx+6gv6X7J5R0qpdX828BsMdhA9IbOs8mXIIKNKYapwcGmx84v0uznl wPNRF2Dqpfa+BUl7C/OW70tLf7igwK0DfiagH3EHgne0x28a44mcgzOsU36zejDsXwBR Ns8J7nJOTupohk/WKW3OAVxC3zP98WJr70Af1Q4PGjiVr6IQ5WMuyHXbvDGRSykObPBB 6Cu8IHPdSIZGvGOHFU4ymMbwzrww/6/vZQNda7AJTMmUBt3FUdixRCflSa64uBGuMWP9 33+Q==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PwlymzBn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCXqcq8ew+rPg4SLwAcaTgixugJkfJQqD7m5fuvxL9DjovdW8LPy0FGuKKmS6yGqJfV0q9wwUDhEglfvMcNAqhRo Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y8-20020a05620a44c800b0078591a5bdd2si8112216qkp.221.2024.02.12.20.40.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2024 20:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PwlymzBn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZkZj-0008Vi-7C; Mon, 12 Feb 2024 23:39:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZkZf-0008Ug-CT for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:16 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZkZd-0005zr-Nq for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:15 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-55f0b2c79cdso5275029a12.3 for ; Mon, 12 Feb 2024 20:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707799152; x=1708403952; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vj8qKfoHRQQSQjKf28SMVg7GGjhkAsn0wq6WSyRxVjw=; b=PwlymzBn0akUrQZRWrVQ7kHLcyz9ruGCnccql5NMkjY4GXPVtcMjFq0JBKzYr47+7k 4Iw2w2/C6LlK8ISm8wtejQnbN921QSBv4P3Wj3oZT/3OldGddOj74E5MdwwEWtTTuowR BEjxrPhsxn2ltB4UutAQLInRgX1qSTv56WTLuMyJLJ7SkP3Hb3VpOc8F09u8GpY9PlE7 Bce06f9rrsZSjDELpSnrz7l23ru8NiTpaj45HNP+KNio7KYhexAMVdmUpPISYwHgBwVe GJEJ5eM9pukPJvlBh6w7RmlLKhkycjlWwo8aM2k4iP83zI0z9/2nBDoMWFjlLb498w2C L0Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707799152; x=1708403952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vj8qKfoHRQQSQjKf28SMVg7GGjhkAsn0wq6WSyRxVjw=; b=H4jfFPC3DB0sw/gIKYYTFKtLK88ooAXvKpRDAgxg8CQrpPgDE5xu+XLx4SM1ObuJmo 5HkzysPAjjpYeaNFo6jkwjwMjvzq4WrM4HBSmfp1rJyBz8V1x4RsOVT5nN4G1kTMvGQS lTqwVo73D4SsiuEq+3cbtQLRBZLEVUFHToWnsIrv4hdmbYebuArlScteONpCIGblsEHP +LNDIhk2fq+Q1kXEcODGXX5PykYVRgZGbgMjMhYC3diPy0FG7vuG2YYu69IH/+xzedIs I7EPbcu+nMrYpYIuAJlYvnCs30Vf3TRHZVrfyrW3xaVKD2SkCWUXmtoOHSk+jIcJmYY/ IBbg== X-Gm-Message-State: AOJu0YySVRel3PrMN7oGX81lBZjHY1PRrhsF6deRxzbZoVQ2l4c4w61g UM+RThyK+OrQvmF+5NyC40ypgVXgYV3J0XaPYLsq1ITKQCGXYc0yFH0SL9HBIO+o6Hsd/Nfu+XD 1 X-Received: by 2002:a17:906:4719:b0:a3c:1291:224 with SMTP id y25-20020a170906471900b00a3c12910224mr5878460ejq.42.1707799151879; Mon, 12 Feb 2024 20:39:11 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW/aEpcgd6hIbqAc/+248471nD5BATvinlkB0wy7tUUPAZtkFgu6Z5yoM2/xA78qfcs6bcxGGaPSEv8qmWyKgcE5j4UPFK9SBT43b2Tt9QDjGdPisI= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id p10-20020a1709061b4a00b00a3c09f3aea8sm872522ejg.211.2024.02.12.20.39.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Feb 2024 20:39:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Gerd Hoffmann , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] hw/usb/uhci: Rename NB_PORTS -> UHCI_PORTS Date: Tue, 13 Feb 2024 05:38:58 +0100 Message-ID: <20240213043859.61019-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213043859.61019-1-philmd@linaro.org> References: <20240213043859.61019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename NB_PORTS as UHCI_PORTS to avoid definition clash with EHCI equivalent: hw/usb/hcd-uhci.h:38:9: error: 'NB_PORTS' macro redefined [-Werror,-Wmacro-redefined] #define NB_PORTS 2 ^ hw/usb/hcd-ehci.h:40:9: note: previous definition is here #define NB_PORTS 6 /* Max. Number of downstream ports */ ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-uhci.h | 4 ++-- hw/usb/hcd-uhci.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h index 69f8b40c49..6d26b94e92 100644 --- a/hw/usb/hcd-uhci.h +++ b/hw/usb/hcd-uhci.h @@ -35,7 +35,7 @@ typedef struct UHCIQueue UHCIQueue; -#define NB_PORTS 2 +#define UHCI_PORTS 2 typedef struct UHCIPort { USBPort port; @@ -59,7 +59,7 @@ typedef struct UHCIState { uint32_t frame_bytes; uint32_t frame_bandwidth; bool completions_only; - UHCIPort ports[NB_PORTS]; + UHCIPort ports[UHCI_PORTS]; qemu_irq irq; /* Interrupts that should be raised at the end of the current frame. */ uint32_t pending_int_mask; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index b95b47f6a4..a03cf22e69 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -322,7 +322,7 @@ static void uhci_reset(DeviceState *dev) s->fl_base_addr = 0; s->sof_timing = 64; - for(i = 0; i < NB_PORTS; i++) { + for(i = 0; i < UHCI_PORTS; i++) { port = &s->ports[i]; port->ctrl = 0x0080; if (port->port.dev && port->port.dev->attached) { @@ -364,7 +364,7 @@ static const VMStateDescription vmstate_uhci = { .fields = (const VMStateField[]) { VMSTATE_PCI_DEVICE(dev, UHCIState), VMSTATE_UINT8_EQUAL(num_ports_vmstate, UHCIState, NULL), - VMSTATE_STRUCT_ARRAY(ports, UHCIState, NB_PORTS, 1, + VMSTATE_STRUCT_ARRAY(ports, UHCIState, UHCI_PORTS, 1, vmstate_uhci_port, UHCIPort), VMSTATE_UINT16(cmd, UHCIState), VMSTATE_UINT16(status, UHCIState), @@ -404,7 +404,7 @@ static void uhci_port_write(void *opaque, hwaddr addr, int i; /* send reset on the USB bus */ - for(i = 0; i < NB_PORTS; i++) { + for(i = 0; i < UHCI_PORTS; i++) { port = &s->ports[i]; usb_device_reset(port->port.dev); } @@ -457,7 +457,7 @@ static void uhci_port_write(void *opaque, hwaddr addr, int n; n = (addr >> 1) & 7; - if (n >= NB_PORTS) { + if (n >= UHCI_PORTS) { return; } port = &s->ports[n]; @@ -514,7 +514,7 @@ static uint64_t uhci_port_read(void *opaque, hwaddr addr, unsigned size) UHCIPort *port; int n; n = (addr >> 1) & 7; - if (n >= NB_PORTS) { + if (n >= UHCI_PORTS) { goto read_default; } port = &s->ports[n]; @@ -609,7 +609,7 @@ static USBDevice *uhci_find_device(UHCIState *s, uint8_t addr) USBDevice *dev; int i; - for (i = 0; i < NB_PORTS; i++) { + for (i = 0; i < UHCI_PORTS; i++) { UHCIPort *port = &s->ports[i]; if (!(port->ctrl & UHCI_PORT_EN)) { continue; @@ -1173,11 +1173,11 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp) s->irq = pci_allocate_irq(dev); if (s->masterbus) { - USBPort *ports[NB_PORTS]; - for(i = 0; i < NB_PORTS; i++) { + USBPort *ports[UHCI_PORTS]; + for(i = 0; i < UHCI_PORTS; i++) { ports[i] = &s->ports[i].port; } - usb_register_companion(s->masterbus, ports, NB_PORTS, + usb_register_companion(s->masterbus, ports, UHCI_PORTS, s->firstport, s, &uhci_port_ops, USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL, &err); @@ -1187,14 +1187,14 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp) } } else { usb_bus_new(&s->bus, sizeof(s->bus), &uhci_bus_ops, DEVICE(dev)); - for (i = 0; i < NB_PORTS; i++) { + for (i = 0; i < UHCI_PORTS; i++) { usb_register_port(&s->bus, &s->ports[i].port, s, i, &uhci_port_ops, USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); } } s->bh = qemu_bh_new_guarded(uhci_bh, s, &DEVICE(dev)->mem_reentrancy_guard); s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, uhci_frame_timer, s); - s->num_ports_vmstate = NB_PORTS; + s->num_ports_vmstate = UHCI_PORTS; QTAILQ_INIT(&s->queues); memory_region_init_io(&s->io_bar, OBJECT(s), &uhci_ioport_ops, s, From patchwork Tue Feb 13 04:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772261 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp89657wre; Mon, 12 Feb 2024 20:40:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUqbMowPNWTuAuDEJCrDY6YWwNvihUC8oeoy1OWqqj+9tbukvZGZSYgZKUZrO4OFVdfZTcP4MnwrKM7ggDfOhI0 X-Google-Smtp-Source: AGHT+IGQ37cUELDOPBSprY50US3boU8NIio9HCtImCGik/zqUJA9F3ywNGXZoQPv+rcIj/JQt3ZN X-Received: by 2002:a05:6214:27e4:b0:68d:b1:3833 with SMTP id jt4-20020a05621427e400b0068d00b13833mr8241417qvb.7.1707799222323; Mon, 12 Feb 2024 20:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707799222; cv=none; d=google.com; s=arc-20160816; b=NjKeEzlRw6j8pIZCoqIr3IHucpOswJ8f57ul7YqpQdVYG+hVzjCa2HXD9nup1X4hwI oCp1WxXYtFW+1wc+XWdt8eiu0ducYDXuItU+RKFppjGa2bOuOspE6HHl3Xh+0GM6wax1 7b9VQUXVTm+vrBOs/P9x/qKhfKl2TunOR+8M5+zSkSIPRtNWHwPvFnCnluWO76gmDDfT WA4pr1vZkKO1V1upMzwIG/ExcF2Mjbhzk/uoE0XpGtmSBRyXd+idmb3Mh+F2nv2gJ8U3 oXvHoSHckoLo1aQSzhl6utFZXsqZDZ4nHjMbbkMIJSMOg3aFmjpP3roGdx/Rf5xne/+8 Vpiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ShumMCIaTbveateThFlQmvKVfpqfzquzqsEpvHvEiZU=; fh=ZqtZtNwtUM3LRf+VBizvK5R+vjP75ObMG3RlKNhiux4=; b=QboPE40e/vukMXcuFeP7j6iz60S4qNpSc7yDoCv7JcHQ4FEZTlbEbmA7ufGfTxsBJc MjX3gR/ri70mXrSUuVnNE99P4RiPa2zw3j3iS1c3YbSJg7CZ2kK3tESTYt8vmEqqhvTb 8JI8656ieGP4WzJAwEsQMPXwIVp4AGbsNi0rSt+ZuRNu3VSt3DQrwwGm/xgyPVousGmp lWFl1SvY+5Nh3ygp4DgqBnYn5acOVDDleWvg0zwg6KEI0wgW5xs0IEMCgOmQq0y4uxWW FrMKP1g9rJ0yY07sgk0D74dv0qRdTY+jqOz+ZgGuLu1WRlLGfME/eKRnSlZc6TKMY28/ ybtA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UMg71gBL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCUCHwp2XBZ57DeLMTZnqsmKKhhIgM3gTcqTQmoNqI4WKrKDXn2bbc75hAwUzyvRCOZjOtMmqMsgTd+QBXeBM487 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 12-20020a05621420cc00b0068cb52a5bf0si2127176qve.55.2024.02.12.20.40.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2024 20:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UMg71gBL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZkZn-0000A7-9f; Mon, 12 Feb 2024 23:39:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZkZl-00007A-HS for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:21 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZkZi-00062P-UM for qemu-devel@nongnu.org; Mon, 12 Feb 2024 23:39:21 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-560c696ccffso8460374a12.1 for ; Mon, 12 Feb 2024 20:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707799157; x=1708403957; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ShumMCIaTbveateThFlQmvKVfpqfzquzqsEpvHvEiZU=; b=UMg71gBLWVaSPx3KQ+EzTDptITgCqKZTLmWq8MqBjSJXztXZk9bNgyttWxz0+cjaTy BMwnf+/SN+kHfygeT/6XTNLr5vMcNXcrS2HRTCHXirw3aM2SXdnmfpM+QLR+d7r9ZdPW uxn8ExWFGARYoI4fOkgj+2YfSuJx1sy9j+DM3xg+TusyZB6A5/vi5TrIlaBwx5Bf0M9q t/9sZd5uSAiNiGkfi6b+alyZwXRR2g1dmpEJn/zBmnDDgddLBbHWB2dzESh4IZxy1Hoa aq3oX8qD75DX4lX+/3XczpvtyQFXJYmBVAlvqlYYVtiHGGH48vA81f66Ri4aV8hegpu9 i6vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707799157; x=1708403957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ShumMCIaTbveateThFlQmvKVfpqfzquzqsEpvHvEiZU=; b=uKAhSuFV8lYGe49P3FoOTxMsNy9EA6FWycVNsQYFRrrR4zXS8c2x8clXAz7ipFJq4m BhwTHs1ezSzCAm1Y5x1DcThzF4isaCDiuxL4QkIc/ZHVYeoTRPERyn3DGYyeuZu1agzR vlVCISxbSlTgqp8INEgBctSLNC7S3fcpfO0u+6xscBRdb1IYiqDgMfZRThqh7S/FOJb3 BGKNdp4DPDCIyxQbs9L+V8sNOuabL7dTs0Yz1KXfgswdAba3p3ScdxyJaFwp3QZqB4Ch T5oRQ/sZy4kTpmQbNG0DGNSRBgPX5Q0Pk0efbD/BxBB9S81xzSAG211uAujr+FRKlGaK 5brg== X-Gm-Message-State: AOJu0YyLkhHzraiSmgMIBGgEzZEJHvAYfk43dPTNw/zvBpLsYLZeCPmA 9bjTIGvrqrd7uBc6Sj11LPx0njE0MhbId0b169OtUuIRciS6NHtuEfORxPxukrx/vP/5VfEWHMg 7 X-Received: by 2002:a17:906:c144:b0:a3c:afe1:7d4e with SMTP id dp4-20020a170906c14400b00a3cafe17d4emr1523737ejc.8.1707799157089; Mon, 12 Feb 2024 20:39:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWVdsejrfcMWqE6T0Me2zYUKPaZe2TmhsZvninkP5xrhx9Vl6FMNAhwS25RF/96p0AoyiradO2bgRC6fXwJS1LF81X3OIk8rXP9LCk8QhgA1Py/wdg= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id vo2-20020a170907a80200b00a3cf66ec008sm376172ejc.166.2024.02.12.20.39.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Feb 2024 20:39:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Gerd Hoffmann , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] hw/usb/ehci: Rename NB_PORTS -> EHCI_PORTS Date: Tue, 13 Feb 2024 05:38:59 +0100 Message-ID: <20240213043859.61019-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213043859.61019-1-philmd@linaro.org> References: <20240213043859.61019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename NB_PORTS as EHCI_PORTS to avoid definition clash with UHCI equivalent: hw/usb/hcd-ehci.h:40:9: error: 'NB_PORTS' macro redefined [-Werror,-Wmacro-redefined] #define NB_PORTS 6 /* Max. Number of downstream ports */ ^ hw/usb/hcd-uhci.h:38:9: note: previous definition is here #define NB_PORTS 2 ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-ehci.h | 8 ++++---- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ehci.c | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 2cd821f49e..56a1c09d1f 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -37,7 +37,7 @@ #define MMIO_SIZE 0x1000 #define CAPA_SIZE 0x10 -#define NB_PORTS 6 /* Max. Number of downstream ports */ +#define EHCI_PORTS 6 /* Max. Number of downstream ports */ typedef struct EHCIPacket EHCIPacket; typedef struct EHCIQueue EHCIQueue; @@ -288,7 +288,7 @@ struct EHCIState { uint32_t configflag; }; }; - uint32_t portsc[NB_PORTS]; + uint32_t portsc[EHCI_PORTS]; /* * Internal states, shadow registers, etc @@ -298,8 +298,8 @@ struct EHCIState { bool working; uint32_t astate; /* Current state in asynchronous schedule */ uint32_t pstate; /* Current state in periodic schedule */ - USBPort ports[NB_PORTS]; - USBPort *companion_ports[NB_PORTS]; + USBPort ports[EHCI_PORTS]; + USBPort *companion_ports[EHCI_PORTS]; uint32_t usbsts_pending; uint32_t usbsts_frindex; EHCIQueueHead aqueues; diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 0b26db74d8..3ff54edf62 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -83,7 +83,7 @@ static void usb_ehci_pci_init(Object *obj) s->capsbase = 0x00; s->opregbase = 0x20; s->portscbase = 0x44; - s->portnr = NB_PORTS; + s->portnr = EHCI_PORTS; if (!dc->hotpluggable) { s->companion_enable = true; diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index bfb774504c..fe1dabd0bb 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -88,7 +88,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(klass); sec->portscbase = 0x44; - sec->portnr = NB_PORTS; + sec->portnr = EHCI_PORTS; dc->realize = usb_ehci_sysbus_realize; dc->vmsd = &vmstate_ehci_sysbus; diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 98a2860069..01864d4649 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -783,9 +783,9 @@ static void ehci_register_companion(USBBus *bus, USBPort *ports[], EHCIState *s = container_of(bus, EHCIState, bus); uint32_t i; - if (firstport + portcount > NB_PORTS) { + if (firstport + portcount > EHCI_PORTS) { error_setg(errp, "firstport must be between 0 and %u", - NB_PORTS - portcount); + EHCI_PORTS - portcount); return; } @@ -831,7 +831,7 @@ static USBDevice *ehci_find_device(EHCIState *ehci, uint8_t addr) USBPort *port; int i; - for (i = 0; i < NB_PORTS; i++) { + for (i = 0; i < EHCI_PORTS; i++) { port = &ehci->ports[i]; if (!(ehci->portsc[i] & PORTSC_PED)) { DPRINTF("Port %d not enabled\n", i); @@ -850,7 +850,7 @@ void ehci_reset(void *opaque) { EHCIState *s = opaque; int i; - USBDevice *devs[NB_PORTS]; + USBDevice *devs[EHCI_PORTS]; trace_usb_ehci_reset(); @@ -858,7 +858,7 @@ void ehci_reset(void *opaque) * Do the detach before touching portsc, so that it correctly gets send to * us or to our companion based on PORTSC_POWNER before the reset. */ - for(i = 0; i < NB_PORTS; i++) { + for(i = 0; i < EHCI_PORTS; i++) { devs[i] = s->ports[i].dev; if (devs[i] && devs[i]->attached) { usb_detach(&s->ports[i]); @@ -877,7 +877,7 @@ void ehci_reset(void *opaque) s->astate = EST_INACTIVE; s->pstate = EST_INACTIVE; - for(i = 0; i < NB_PORTS; i++) { + for(i = 0; i < EHCI_PORTS; i++) { if (s->companion_ports[i]) { s->portsc[i] = PORTSC_POWNER | PORTSC_PPOWER; } else { @@ -1086,7 +1086,7 @@ static void ehci_opreg_write(void *ptr, hwaddr addr, case CONFIGFLAG: val &= 0x1; if (val) { - for (i = 0; i < NB_PORTS; i++) { + for (i = 0; i < EHCI_PORTS; i++) { handle_port_owner_write(s, i, 0); } } @@ -2427,7 +2427,7 @@ static int usb_ehci_post_load(void *opaque, int version_id) EHCIState *s = opaque; int i; - for (i = 0; i < NB_PORTS; i++) { + for (i = 0; i < EHCI_PORTS; i++) { USBPort *companion = s->companion_ports[i]; if (companion == NULL) { continue; @@ -2509,9 +2509,9 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) { int i; - if (s->portnr > NB_PORTS) { + if (s->portnr > EHCI_PORTS) { error_setg(errp, "Too many ports! Max. port number is %d.", - NB_PORTS); + EHCI_PORTS); return; } if (s->maxframes < 8 || s->maxframes > 512) {