Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2437967pxb; Thu, 4 Nov 2021 21:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZI/GZsrFkFdKHN3nS+x7NM2hYyy2lA1jwC1GAaaWHLjpT/VyWRAZdL0rg5RmWqe7SDBLN X-Received: by 2002:a05:6e02:1b88:: with SMTP id h8mr22498557ili.124.1636085558745; Thu, 04 Nov 2021 21:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636085558; cv=none; d=google.com; s=arc-20160816; b=a5RrOPsAY61vpo3uSSzFUu2X44B0liUuv75r5Q+LsRdtvw0Ps1gTaAa2zf9dn92rc7 /dgJdiBixkhx/Zzvj17wJGXoP593fJfeZkDKHYkv5+q4Y7LK3FkqZNDjb7yP1SWzIG0w Sq6EE0SvYgsJRznuVuvSEDSOlyGRcmA4ModsMrDPV2p5nNhVBBwKOzkk3ie1XIgarKdV zIgTZyFdqXWcA0rcysZcEFRYTS1zJTD8sCiW9++gFB/Cy9XytiWMcDRoylvOFbUFCdYK GiwGMOHsb4JVEEhtNchocYBU+VzSPFckCPSWlhgScH4P89oJWval86tdqHwKrpMsza0Q GUfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xCcEqsnBhifvXkjiVwnMz5H8oH0AK0pj5dvEeQNewCw=; b=mibyVuE7gKAzw8YCHSrzevhGZ8X+Kfza1mUqa4kqXcQJxlNrB1VykYOEEhKQcOXujV Ur0J/p9MCs7m1771VolV+fmzRev+qFcoSsJvVDuJ1bs2d+s6zW2ZvoyJ3u5DRrd2V+7/ ujqFcPUEc01wi688b86bZYvsYcXjF+e4ZepRu9tDH5tQS2GnYs4Gwq2ySpYcyil9KZHC R3j+UtpoC0+kZofLeeoVGHwM8wPQxrWLukN3Ba1BtVv8f6477AKjalwN76u/1y9f0yg8 MwSJ1wnFw9lPtEgaq+eFVRoFjDGh77eI6lRhWHWrN8Lmz9E2JpM34Z8/H71vaM+vz520 NmyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P8PsQLaN; 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 m16si10240128ioo.85.2021.11.04.21.12.25; Thu, 04 Nov 2021 21:12:38 -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=P8PsQLaN; 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 S231937AbhKECvc (ORCPT + 99 others); Thu, 4 Nov 2021 22:51:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22969 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbhKECva (ORCPT ); Thu, 4 Nov 2021 22:51:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636080530; 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=xCcEqsnBhifvXkjiVwnMz5H8oH0AK0pj5dvEeQNewCw=; b=P8PsQLaNAFe15EoPXLqHJvLqhI1Mh4ZsRfcc7kfMHOj+KTZaA4ai9RzeQi6upWs/Xu+UDQ bckjdU+b+xk7KUPJ7cKqAWV7BE5QsWEQyjRlON7wF+GsoprcI2J9VfHcjEJI3QvV2BwlwA fAYtj+Rj93Mxwt16uTrxiRsLIJWxp/I= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-rNlT9YvMPkC819Jor8MiwQ-1; Thu, 04 Nov 2021 22:48:49 -0400 X-MC-Unique: rNlT9YvMPkC819Jor8MiwQ-1 Received: by mail-lf1-f71.google.com with SMTP id b18-20020a0565120b9200b00401dbc6433aso2020791lfv.8 for ; Thu, 04 Nov 2021 19:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xCcEqsnBhifvXkjiVwnMz5H8oH0AK0pj5dvEeQNewCw=; b=d6tQ7atpCg6B+ca6AglpMYyjdBNy4VvGN2Wgbq/dKtLL5exaBWEYMeESuEfUUATtox sgwBwxMLvKGqEj0EfsAbwbqlKPrxZPBIc6eAi96CuSbgDPGGx0kG2M9Ofpqsb4ZhU66l y6DJ5YE96SiWIvHJLCH/8IhQBmw/NsJxphNxjlrrzX/seXZR16fjyAXBZdxSoYuwVl2T vvcPVud6v0IrrZjEHRAg/kPdqgQVerWGu077Nr9eiqbuR54/aD4B3uD0KTt7bnmAwJSR ckK2XU0fXPsPiwMEi2kYdfADcCK8vfIZZYhz2WCBGrlFZ1vZ1St4nJWkrHf0xp34IijF Ka6A== X-Gm-Message-State: AOAM5338RF2BRFyzWrTzRrR+tz7I33390Wt/LqMKt+fU5HAdum+sr+Th pybmHvEoo+sWU852FLJpO/2yRgbEDmjQ8Sv98xtfTeQ42xbqs9SOVTN9ZEOsDJKcu7uHuBw4MDt DOfSEjRuEgiEXB4SBYrRg9UI6VaqN+aWPKlsf2HT1 X-Received: by 2002:ac2:4e68:: with SMTP id y8mr52932392lfs.348.1636080528102; Thu, 04 Nov 2021 19:48:48 -0700 (PDT) X-Received: by 2002:ac2:4e68:: with SMTP id y8mr52932379lfs.348.1636080527953; Thu, 04 Nov 2021 19:48:47 -0700 (PDT) MIME-Version: 1.0 References: <20211104195833.2089796-1-eperezma@redhat.com> In-Reply-To: <20211104195833.2089796-1-eperezma@redhat.com> From: Jason Wang Date: Fri, 5 Nov 2021 10:48:37 +0800 Message-ID: Subject: Re: [PATCH] vdpa: Avoid duplicate call to vp_vdpa get_status To: =?UTF-8?Q?Eugenio_P=C3=A9rez?= Cc: linux-kernel , "Michael S. Tsirkin" , kvm , virtualization , netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 5, 2021 at 3:58 AM Eugenio P=C3=A9rez wro= te: > > It has no sense to call get_status twice, since we already have a > variable for that. > > Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang > --- > drivers/vhost/vdpa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 01c59ce7e250..10676ea0348b 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -167,13 +167,13 @@ static long vhost_vdpa_set_status(struct vhost_vdpa= *v, u8 __user *statusp) > status_old =3D ops->get_status(vdpa); > > /* > * Userspace shouldn't remove status bits unless reset the > * status to 0. > */ > - if (status !=3D 0 && (ops->get_status(vdpa) & ~status) !=3D 0) > + if (status !=3D 0 && (status_old & ~status) !=3D 0) > return -EINVAL; > > if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO= _CONFIG_S_DRIVER_OK)) > for (i =3D 0; i < nvqs; i++) > vhost_vdpa_unsetup_vq_irq(v, i); > > -- > 2.27.0 >