Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp9712pxk; Wed, 23 Sep 2020 20:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+7xW31b6/1oz4dn+OG4jtpI4VkPs5jI9ir6MCGXaVjaAdNbg2bjizrB3WTFRIqDTKvv1r X-Received: by 2002:a17:906:2f0c:: with SMTP id v12mr2587017eji.484.1600917877036; Wed, 23 Sep 2020 20:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600917877; cv=none; d=google.com; s=arc-20160816; b=a4nXP7bIztFXT28A4/nIZvN4wG2a4kMKsZ301lqH79B7+5AGI2oo7VDgnjwvUOIrgC SXvHkNqN2i5SUMj9Dk2HSthplxUwNAyQgJSJY5X1/SyffmVqVEx7ZxNylLcpauTrWamp xmjK9onGHtl+mGHk4Qa9XTnP2OJoPlfDHMO7G72RwhqAyQXtFviZHgYsjISAQpkFj6Wh BUYgBjlTyJM+qvmr3b5ERaWFSgiWXJLWp3u67W6F0AxlQ516T1+ycklKvJpZbIWyHr5D a6waivg7d55h/uaVj32CZ2gowQnoxKRXIZQNk8dplJsyMkhuZVjUXeH71gHT909oZ9VQ M+jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Wjy4504cstLZT/a9s8xAMUauA+PFi260PeYanPN/xQ=; b=eg3ZkY2xd7vMuMywKPZGfhzqaCFBBe0+DJl45vucNUZzO/A0kJuLX684jC6g3aovCs xJO+gZ8+4EACXUrdrjIuVyMtVK0g1eGcfydoG/AW0gAJjK4OCam1K2oBey0zrQBoF4pi KSeNVVm5u9w20aGyWHVwaCfnlNplHa43nsOm54ZAOi8y4/QT3ZpV5HJukDvOKuF4IzSu yUL1fB3DuC/pjCxroASHubvat+btdsUjiP6Q7AvXcWCNTKIm4CrnB9eZxmH7EzoFm1bb oVKJurLWRRokgFqChSh/Oerb/1H4c/8UM/W7WmC0C8KrObqc/yEVw5LutOvxobt/hkhg cRKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b3JstbkL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si1429497edw.41.2020.09.23.20.24.13; Wed, 23 Sep 2020 20:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b3JstbkL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbgIXDWf (ORCPT + 99 others); Wed, 23 Sep 2020 23:22:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47710 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbgIXDWe (ORCPT ); Wed, 23 Sep 2020 23:22:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600917753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Wjy4504cstLZT/a9s8xAMUauA+PFi260PeYanPN/xQ=; b=b3JstbkLMkBpEtjsMYkW1GBqMOE4QpWR/mgigKSEST6Lpxay2182T96uPRkQNPxpW+fFPT 3jZxQMDu3GE6AX7JkkMcADiEgoulKTbLp2byZV2Nezo0t/fMdJGcN1mbkRRmV0Z+MyiPxD W0qCQD0Rc77wEEXXy4bBehysxY6NNKk= 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-500-Z9KOmGBVO_KxBQn3k61XmQ-1; Wed, 23 Sep 2020 23:22:30 -0400 X-MC-Unique: Z9KOmGBVO_KxBQn3k61XmQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAABF81CAFC; Thu, 24 Sep 2020 03:22:28 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-193.pek2.redhat.com [10.72.13.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65D1F55777; Thu, 24 Sep 2020 03:22:12 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: lulu@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, hanand@xilinx.com, mhabets@solarflare.com, eli@mellanox.com, amorenoz@redhat.com, maxime.coquelin@redhat.com, stefanha@redhat.com, sgarzare@redhat.com Subject: [RFC PATCH 04/24] virtio-vdpa: don't set callback if virtio doesn't need it Date: Thu, 24 Sep 2020 11:21:05 +0800 Message-Id: <20200924032125.18619-5-jasowang@redhat.com> In-Reply-To: <20200924032125.18619-1-jasowang@redhat.com> References: <20200924032125.18619-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's no need for setting callbacks for the driver that doesn't care about that. Signed-off-by: Jason Wang --- drivers/virtio/virtio_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 4a9ddb44b2a7..af6ee677f319 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -175,7 +175,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index, } /* Setup virtqueue callback */ - cb.callback = virtio_vdpa_virtqueue_cb; + cb.callback = callback ? virtio_vdpa_virtqueue_cb : NULL; cb.private = info; ops->set_vq_cb(vdpa, index, &cb); ops->set_vq_num(vdpa, index, virtqueue_get_vring_size(vq)); -- 2.20.1