From patchwork Tue Feb 27 08:39:33 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: 1904919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=rcJligoQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TkWNR0Jmbz23qN for ; Tue, 27 Feb 2024 19:48:23 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ret2H-0000fm-3f; 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 1ret1y-0007vQ-MT for qemu-ppc@nongnu.org; Tue, 27 Feb 2024 03:41:44 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ret1w-0008AI-06 for qemu-ppc@nongnu.org; Tue, 27 Feb 2024 03:41:42 -0500 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d24a727f78so55687021fa.0 for ; Tue, 27 Feb 2024 00:41:38 -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=XB39K/j8Csh0jceTO1VJBPJjzqx/rSVYuYWmsbaPXT3ujAju5uaDzCX/JeELD106Az dQwT3CYglF/5iHrfKG9Hiedyzx1RNuriBMkZinXg6BCCsv9NqbYm9pSoYNzPaG9vfL1L EMHnp6YPA/7+hYxom5m8aNkpG1RGaZMjTszQS1p8/38jT/Hh/Q9ZXWh55Q9cx1CXPsfR pwXp8hHWJlVSR8yezXh08qTEM/uKuyqJyZDpTQyXeKlSYbVjUZVZ8ooKSBB2JbYYabg8 BCYwls3UfnrGuopIU50wRGxHTU4avBRnLzxT2J8HwZZrQY3pRdQ3bqrUrlTMTwIMb01c eSaA== X-Gm-Message-State: AOJu0Yw1vCPxOQAT9lJlh7PhaDmdWUARTbZUd4tOoEssAYOj5u0Cj9Cs gGZ4aeWLmbHxo030CQQRUPqFLZrVSLdbhxt5JyP598FmzrK3MEU8kmHHb/7vkGI= 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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é Message-ID: <20240223124406.234509-9-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- 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); } -USBBus *usb_bus_find(int busnr) -{ - USBBus *bus; - - if (-1 == busnr) - return QTAILQ_FIRST(&busses); - QTAILQ_FOREACH(bus, &busses, next) { - if (bus->busnr == busnr) - return bus; - } - return NULL; -} - static void usb_device_realize(USBDevice *dev, Error **errp) { USBDeviceClass *klass = 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 = usb_bus_find(-1 /* any */); + USBBus *bus = QTAILQ_FIRST(&busses); LegacyUSBFactory *f = NULL; Error *err = NULL; GSList *i;