From patchwork Fri Jun 19 18:22:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugenio Perez Martin X-Patchwork-Id: 11614909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9D02913 for ; Fri, 19 Jun 2020 18:24:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1DE321527 for ; Fri, 19 Jun 2020 18:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TcR5TugW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436642AbgFSSYw (ORCPT ); Fri, 19 Jun 2020 14:24:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38448 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387968AbgFSSX3 (ORCPT ); Fri, 19 Jun 2020 14:23:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592591007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TtSatW4fx1QmInWApX4FeSfqG2/RwS871fY7cs8kwpU=; b=TcR5TugW8N8OQQPateCVXL6aguLkOxm3KVuoVKDaAIM9VPrMAwL2JkMTGxCJTH9XgX9kXF 1FciBrCMoxy83Ni6aJjxyD3QeKSW5LxljNQ046teIhS3IuQZ4T4nbNKTOk1BPbyHBBFHEL GMlx4fnYWjbh+Kby6rFUBNzskNtdt2I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-NC5tv3sAPp2arDDP1jaJYg-1; Fri, 19 Jun 2020 14:23:23 -0400 X-MC-Unique: NC5tv3sAPp2arDDP1jaJYg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5AE79107ACCD; Fri, 19 Jun 2020 18:23:22 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-113-14.ams2.redhat.com [10.36.113.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68F651C8; Fri, 19 Jun 2020 18:23:20 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= To: mst@redhat.com Cc: kvm list , Stefano Garzarella , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Stefan Hajnoczi , Jason Wang Subject: [RFC v9 04/11] vhost: reorder functions Date: Fri, 19 Jun 2020 20:22:55 +0200 Message-Id: <20200619182302.850-5-eperezma@redhat.com> In-Reply-To: <20200619182302.850-1-eperezma@redhat.com> References: <20200619182302.850-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: "Michael S. Tsirkin" Reorder functions in the file to not rely on forward declarations, in preparation to making them static down the road. Signed-off-by: Michael S. Tsirkin Signed-off-by: Eugenio PĂ©rez --- drivers/vhost/vhost.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 13021d6986eb..ba8da8785ede 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2424,19 +2424,6 @@ void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) } EXPORT_SYMBOL_GPL(vhost_discard_vq_desc); -/* After we've used one of their buffers, we tell them about it. We'll then - * want to notify the guest, using eventfd. */ -int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) -{ - struct vring_used_elem heads = { - cpu_to_vhost32(vq, head), - cpu_to_vhost32(vq, len) - }; - - return vhost_add_used_n(vq, &heads, 1); -} -EXPORT_SYMBOL_GPL(vhost_add_used); - static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) @@ -2506,6 +2493,19 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, } EXPORT_SYMBOL_GPL(vhost_add_used_n); +/* After we've used one of their buffers, we tell them about it. We'll then + * want to notify the guest, using eventfd. */ +int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) +{ + struct vring_used_elem heads = { + cpu_to_vhost32(vq, head), + cpu_to_vhost32(vq, len) + }; + + return vhost_add_used_n(vq, &heads, 1); +} +EXPORT_SYMBOL_GPL(vhost_add_used); + static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) { __u16 old, new;