From nobody Tue Nov 26 08:40:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709023595; cv=none; d=zohomail.com; s=zohoarc; b=FKS2ReMW6cm3VZS+LD3yvISOQw/S0is8+9q2wbdRmLI9nG5ku+cSiuF65CENRDS5AhAtXtyeUY84VYj1pwYMMly1J+Hk63QVSwPENcyVGnVSW7qKgZcPTDCIi2Y3Av+TWOLQaOeShs2o37d18G32Xr2SEObCyCPDxSYkKcmNsqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709023595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=MuYJL37HJi3EIlRNlB0qcrLcU7NDaNQg+PPG00EfHHPpLUlYjt8xd/A6WX7bOccP3iFrah79Ai3gVTsNSvrH2tbB6nwULZ2xsTDqno7tCfjSClUrMEeW2j+d6AT5Fp2rOMlkjPwc2VzX16o4pUUPOllHsJ+ANQtIlQyo0CIbbIo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709023595318291.7467218002796; Tue, 27 Feb 2024 00:46:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2H-0000j2-Ma; Tue, 27 Feb 2024 03:42:01 -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 1ret1x-0007u6-KN for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:43 -0500 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1w-0008AR-0R for qemu-devel@nongnu.org; Tue, 27 Feb 2024 03:41:41 -0500 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2d220e39907so63255661fa.1 for ; Tue, 27 Feb 2024 00:41:39 -0800 (PST) Received: from m1x-phil.lan (mic92-h03-176-184-33-214.dsl.sta.abo.bbox.fr. [176.184.33.214]) by smtp.gmail.com with ESMTPSA id n1-20020a2e82c1000000b002d236114533sm1162859ljh.75.2024.02.27.00.41.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Feb 2024 00:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709023297; x=1709628097; 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=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=rcJligoQblwAJ4JCuYj7ylTS9+N3IYln4qB/Be9hSHJGr8Na6JAqdv8q1MBbLHKePm UXarjKcg70IsR1k25gI19UVIUG2Q9GA3/zcVNTI3K8nS2FT+eSNHfezttGMqos1IoNqi U8J09SlkTtSXxqiHInisBATNsaX7J8yWC9vpSpEKtW19xgswqGiAL+1Zl4vHJooO1/72 wJ/zoGrvKZLA5JXeF24aDgE8Vm/M0yPYabPx8kJloQY0krQvhWC9Ix2yOTuL7FBWtjW/ qgDa3UBlrj3H56xN3N+NraT9wUyFFWFp9pAZMu4xxkBdGRnrTaHpPrzNMBOFLkE9afNE WHew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709023297; x=1709628097; 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=RPm16UPsnU4F/4oJXar+5N8ETXoxZOH1kbNjYRQpNV0=; b=X8ORfNwXY4oQtrDy7bJYP0EUN9YMbC4fCmGusm/wcRB4RPmKSgPOqsqepv2yHUBqj0 5CAlHDsbUl5uWFExK5qBByjV93eZ5qhIQIR7Ar2MqH38N+7ZO6dqZqyvfS3ilJ4tL/4Q cptQk3mky+WXWhK/7X5g6rbu51rI5yoc5H/4w6qCArYFUBtl+OqtWfSJev2P/hll7aWV BChFlzCX7wycTyJ7IPuvbWr+pB1KNJYtPCJrwJ/+hbtzXH1lp6s7loUj7O3p7KJHjmJF 1XcxxMM796Rb0G79MvtNyudQ/kYivMjDtb1KQfABz/h1MSTwXsdtyHycTwTBDnusZWPf 4omA== X-Gm-Message-State: AOJu0YzxzBHiDPGz6Mec+PnNiAD4JumONGYlOimoMnj8muDWAMzirknw Ni7OGyt2EvcA09qPgtAUcfiXKzpafeXtWB0n5VcfIr/P2dAwppfVB8PVHUnLjw40nJ29b01ldWo J X-Google-Smtp-Source: AGHT+IFcaDayJbT4H+1fH7SfXNgHNb226cHPP5331/6xu5QjiH4t6uJV5SqFwlEyBu/IKD0duQzz6w== X-Received: by 2002:a2e:8784:0:b0:2d2:3c10:4b6c with SMTP id n4-20020a2e8784000000b002d23c104b6cmr5534555lji.24.1709023297560; Tue, 27 Feb 2024 00:41:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PULL 17/30] hw/usb: remove usb_bus_find Date: Tue, 27 Feb 2024 09:39:33 +0100 Message-ID: <20240227083948.5427-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240227083948.5427-1-philmd@linaro.org> References: <20240227083948.5427-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709023595913100002 From: Paolo Bonzini Inline the sole remaining use, which is for the -usbdevice command line. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240223124406.234509-9-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/usb.h | 1 - hw/usb/bus.c | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index cfeead2840..d46d96779a 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -498,7 +498,6 @@ struct USBBusOps { void usb_bus_new(USBBus *bus, size_t bus_size, USBBusOps *ops, DeviceState *host); void usb_bus_release(USBBus *bus); -USBBus *usb_bus_find(int busnr); void usb_legacy_register(const char *typename, const char *usbdevice_name, USBDevice *(*usbdevice_init)(void)); USBDevice *usbdevice_create(const char *cmdline); diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 76fda41b7e..796769fadb 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -100,19 +100,6 @@ void usb_bus_release(USBBus *bus) QTAILQ_REMOVE(&busses, bus, next); } =20 -USBBus *usb_bus_find(int busnr) -{ - USBBus *bus; - - if (-1 =3D=3D busnr) - return QTAILQ_FIRST(&busses); - QTAILQ_FOREACH(bus, &busses, next) { - if (bus->busnr =3D=3D busnr) - return bus; - } - return NULL; -} - static void usb_device_realize(USBDevice *dev, Error **errp) { USBDeviceClass *klass =3D USB_DEVICE_GET_CLASS(dev); @@ -643,7 +630,7 @@ HumanReadableText *qmp_x_query_usb(Error **errp) /* handle legacy -usbdevice cmd line option */ USBDevice *usbdevice_create(const char *driver) { - USBBus *bus =3D usb_bus_find(-1 /* any */); + USBBus *bus =3D QTAILQ_FIRST(&busses); LegacyUSBFactory *f =3D NULL; Error *err =3D NULL; GSList *i; --=20 2.41.0