From nobody Sun Nov 24 02:35:43 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=treblig.org ARC-Seal: i=1; a=rsa-sha256; t=1726692804; cv=none; d=zohomail.com; s=zohoarc; b=T9hsHkdhc67wYMfVUDBICoGRy21YP/Rg3Azq7pUejYHc+m/LiUA5zCv64GnzZeAJwDo2anL9NSajFHc3iDoLXGLRMvvCFncSiOpSSGjNlpN/854qIPyO3MfwvWZKl//BHnjMBlL3ITEqSr4L4Mqw/9gBXauKShNnAM5LMR0iUy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726692804; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l66vfY6FwdV4zag7Q0tLWaWPKalJm5Zmp5Gxv7K/RIA=; b=gNI62/AeICymiPZ4N8o6GjAkD7Avf2M33vVxbsutQioEkTMcRE83QsNiYeEAk1mjItHuSx9s7vDURGboRJ6phaNxW+YUfboAVHdox3IHi+vOuEnnYt8kXCdvFnY9SrEOp0s5FEO5EGg8mPNtFehvy521ee9CN1KYNxrreSuoVd4= 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 1726692804759812.6830710344532; Wed, 18 Sep 2024 13:53:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sr1fh-0004oC-48; Wed, 18 Sep 2024 16:53:09 -0400 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 1sr1fd-0004e5-TG for qemu-devel@nongnu.org; Wed, 18 Sep 2024 16:53:05 -0400 Received: from mx.treblig.org ([2a00:1098:5b::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sr1fb-0008I2-U8 for qemu-devel@nongnu.org; Wed, 18 Sep 2024 16:53:05 -0400 Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sr1fX-006L8s-0m; Wed, 18 Sep 2024 20:52:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=l66vfY6FwdV4zag7Q0tLWaWPKalJm5Zmp5Gxv7K/RIA=; b=UddxxjN48ezbBni4 ow1x7PIFTuPzt3Dqz3k6CSsgTRnRyzlcgKB6hYQpTjcFXHQZl/UkKKjFl+QbP9PzEFketX8JXDKTF q3+xV/4ocuUBFYJSYp0J/GnTT882TUxfJg9xC0KjBOMOYQtCXf0lABfmBnB3jRs0ow85d1zKUaqs1 L3cAVcYzH1RqD1awdIElRFqrzejBabCn/LolLajIWQZA3wkY6J84zmWRycmJ8W+27WI1N+C1F6ecX ermyvPmv45GMyp79dsm2JrXLUsDp0D1d48oZNp4rADs20XeCU1f8izKaA9AYZQ0k5lAYw3zVzm6B+ oUJjNGOl/ytmOdJ8RQ==; From: dave@treblig.org To: jasowang@redhat.com, qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" Subject: [PATCH] net: Remove deadcode Date: Wed, 18 Sep 2024 21:52:58 +0100 Message-ID: <20240918205258.444880-1-dave@treblig.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 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:1098:5b::1; envelope-from=dave@treblig.org; helo=mx.treblig.org 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @treblig.org) X-ZM-MESSAGEID: 1726692806657116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" net_hub_port_find is unused since 2018's commit af1a5c3eb4 ("net: Remove the deprecated "vlan" parameter") qemu_receive_packet_iov is unused since commit ffbd2dbd8e ("e1000e: Perform software segmentation for loopback") in turn it was the last user of qemu_net_queue_receive_iov. Remove them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Thomas Huth --- include/net/net.h | 4 ---- include/net/queue.h | 4 ---- net/hub.c | 25 ------------------------- net/net.c | 10 ---------- net/queue.c | 11 ----------- 5 files changed, 54 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index c8f679761b..cdd5b109b0 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -172,9 +172,6 @@ ssize_t qemu_sendv_packet_async(NetClientState *nc, con= st struct iovec *iov, int iovcnt, NetPacketSent *sent_cb); ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size); ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int si= ze); -ssize_t qemu_receive_packet_iov(NetClientState *nc, - const struct iovec *iov, - int iovcnt); ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize); ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf, int size, NetPacketSent *sent_cb); @@ -307,7 +304,6 @@ void hmp_host_net_remove(Monitor *mon, const QDict *qdi= ct); void netdev_add(QemuOpts *opts, Error **errp); =20 int net_hub_id_for_client(NetClientState *nc, int *id); -NetClientState *net_hub_port_find(int hub_id); =20 #define DEFAULT_NETWORK_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifdown" diff --git a/include/net/queue.h b/include/net/queue.h index 9f2f289d77..2e686b1b61 100644 --- a/include/net/queue.h +++ b/include/net/queue.h @@ -59,10 +59,6 @@ ssize_t qemu_net_queue_receive(NetQueue *queue, const uint8_t *data, size_t size); =20 -ssize_t qemu_net_queue_receive_iov(NetQueue *queue, - const struct iovec *iov, - int iovcnt); - ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, diff --git a/net/hub.c b/net/hub.c index 4c8a469a50..496a3d3b4b 100644 --- a/net/hub.c +++ b/net/hub.c @@ -193,31 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const cha= r *name, return &port->nc; } =20 -/** - * Find a available port on a hub; otherwise create one new port - */ -NetClientState *net_hub_port_find(int hub_id) -{ - NetHub *hub; - NetHubPort *port; - NetClientState *nc; - - QLIST_FOREACH(hub, &hubs, next) { - if (hub->id =3D=3D hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - nc =3D port->nc.peer; - if (!nc) { - return &(port->nc); - } - } - break; - } - } - - nc =3D net_hub_add_port(hub_id, NULL, NULL); - return nc; -} - /** * Print hub configuration */ diff --git a/net/net.c b/net/net.c index fc1125111c..d9b23a8f8c 100644 --- a/net/net.c +++ b/net/net.c @@ -750,16 +750,6 @@ ssize_t qemu_receive_packet(NetClientState *nc, const = uint8_t *buf, int size) return qemu_net_queue_receive(nc->incoming_queue, buf, size); } =20 -ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *io= v, - int iovcnt) -{ - if (!qemu_can_receive_packet(nc)) { - return 0; - } - - return qemu_net_queue_receive_iov(nc->incoming_queue, iov, iovcnt); -} - ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize) { return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW, diff --git a/net/queue.c b/net/queue.c index c872d51df8..fb33856c18 100644 --- a/net/queue.c +++ b/net/queue.c @@ -193,17 +193,6 @@ ssize_t qemu_net_queue_receive(NetQueue *queue, return qemu_net_queue_deliver(queue, NULL, 0, data, size); } =20 -ssize_t qemu_net_queue_receive_iov(NetQueue *queue, - const struct iovec *iov, - int iovcnt) -{ - if (queue->delivering) { - return 0; - } - - return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt); -} - ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, --=20 2.46.0