Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3982882pxu; Mon, 12 Oct 2020 06:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0sYHup+0a8b2yEHfqt2RmES663kl+4QBUvQ3g1Si1qdxx9EyeUi4fPd4zNeHELRtd2uAz X-Received: by 2002:a05:6402:602:: with SMTP id n2mr14468651edv.327.1602509830985; Mon, 12 Oct 2020 06:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602509830; cv=none; d=google.com; s=arc-20160816; b=FgF9GT5KE2keuE89LOLf720I/4bnPSFDvyPhTF6pqTaeyHfXjbJRLlPFHH6Vyax07x fkTAPSBCOHctwG0QyOGK9Lxeq5cu0ji9iD0Gqr3AOG9Va3GElaY5lMT5NdNlS61eCDlI F8VWbivrciJAxpOS7KrZ/jrSQOAJxv9+xbqOGyDIspaTqyXPAi9ezuIuS8qLnJPtj/AS 8dCL8yIBJFKYQu+7xAy7hBMLGz/PbT6Aelb5lBnHqu0zDvF7vMcM36VUoNkyxVtcRd4k 1YaShiIyBayDj6EzS0Zc+mssDCGXCnFuXTdCRcRpS6srfFSnxulN2WblWDPizUwu3ANz Q2OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6XlKFYoGp/9Yp1zRFm8Sy327KOHtLJ5llMoPdKvcscA=; b=LoacECIQCfW8gxr3WzIqnPD+uEk3JBZ1Zt72Kj9A6wMaiAcE33xBU7wVPeeD0HUp/p 8j/YffRlMDK2gNRgdR9chfLP/j23FDiF+quPDMHlGSlIer6iBXCilRjdovNynHGZBRIm 1qp56jUTL6z+8/tkr/LZ8t4lFCCffCS6ktHKl7FIb1/z6CvnRvDJcqXe57bCSJB2+VyG xc2/F8uLyLkxWaQi9UH0O8at4QjGXRdyfJQSa4/RuPPmdQp8s6InsGqbFus+KuBugzge m1ka72vNQmbrGyokDVs5/NHi0OwZGbbbtwMQ9VdrWj02AycQRUcHSMhoYKeAfNmNf7yV jRnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jAGHmTf5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si12436297edu.307.2020.10.12.06.36.46; Mon, 12 Oct 2020 06:37:10 -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=@gmail.com header.s=20161025 header.b=jAGHmTf5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388691AbgJLNKI (ORCPT + 99 others); Mon, 12 Oct 2020 09:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388684AbgJLNKI (ORCPT ); Mon, 12 Oct 2020 09:10:08 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3876C0613D0 for ; Mon, 12 Oct 2020 06:10:07 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id d20so17576763iop.10 for ; Mon, 12 Oct 2020 06:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6XlKFYoGp/9Yp1zRFm8Sy327KOHtLJ5llMoPdKvcscA=; b=jAGHmTf5Nduq/fQUv+4nxjuTCU+LwWMr13IeDChxgwAclrtAvqi8ibY6kOF/HkeCAy LJ0Dtm0wZ5876fZRWreg6cYHCGlR3RjiSEIme4jwJt2JykPyxOmQAYETSMpdJMVE7s6J Dnw2y5HbsWr6nN3fpKAG3nzdiPtIo4eWlKF91vunAMAir8/dsVHdavzNYX3znB14XWdr JNAJnFXxXoDy3fXAI/pQeEMcSk5ozcgC5wiXd0136HcmPZNk4V483t43ETquo8uAQ8SB sLn/T521yuk7OPnqBI6DIHN4cnZFk/JwexylrdOYCsXwrVuaVLh2rI4XJ3TcakJtH3cu E7aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6XlKFYoGp/9Yp1zRFm8Sy327KOHtLJ5llMoPdKvcscA=; b=kCDP6lYpt76n9hhL2pV26PY4Zv90oI1LBPthRIcCPfH6C3oFesro/zl2KeFp+gSo9+ S55MDywzqRIZlTHpFpjGx3/xzf+5xoycA4m/lTaZfuHXmxWWi4tHU4umWtP8Zllbb1gY aLCB/hbZxtVT51+2Omv24YFGX9beSGOlZ+6++Pkt/lcHKgLY9bZI5voNkepFydBXM5hZ z53BYR1s7u0OcIPr3jP7FUEm4n2mT9F163Gy194HveYaluq4DtbZG94Ew0JlQPsk1O7j RyXfaBlzUkiBmJ9mePMoQvI0UhheSE+oSBTaQHQWZw/V9bXqVPb0A5QSSTYc2MmSeYdr MLcg== X-Gm-Message-State: AOAM533P4BpyZlWBPH49C718c5AvNAXYnJQ+zvNc5lRCcjb9ltbdZlsZ nH3uI64bsiRKCJLqYhkS8/zxmI5ouNiqxeMYpoM= X-Received: by 2002:a5d:8b4c:: with SMTP id c12mr16754244iot.167.1602508207125; Mon, 12 Oct 2020 06:10:07 -0700 (PDT) MIME-Version: 1.0 References: <20201012125323.17509-1-david@redhat.com> <20201012125323.17509-5-david@redhat.com> In-Reply-To: <20201012125323.17509-5-david@redhat.com> From: Pankaj Gupta Date: Mon, 12 Oct 2020 15:09:55 +0200 Message-ID: Subject: Re: [PATCH v1 04/29] virtio-mem: drop rc2 in virtio_mem_mb_plug_and_add() To: David Hildenbrand Cc: LKML , Linux MM , virtualization@lists.linux-foundation.org, Andrew Morton , "Michael S . Tsirkin" , Jason Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c > index 78c2fbcddcf8..b3eebac7191f 100644 > --- a/drivers/virtio/virtio_mem.c > +++ b/drivers/virtio/virtio_mem.c > @@ -1072,7 +1072,7 @@ static int virtio_mem_mb_plug_and_add(struct virtio_mem *vm, > uint64_t *nb_sb) > { > const int count = min_t(int, *nb_sb, vm->nb_sb_per_mb); > - int rc, rc2; > + int rc; > > if (WARN_ON_ONCE(!count)) > return -EINVAL; > @@ -1103,13 +1103,12 @@ static int virtio_mem_mb_plug_and_add(struct virtio_mem *vm, > > dev_err(&vm->vdev->dev, > "adding memory block %lu failed with %d\n", mb_id, rc); > - rc2 = virtio_mem_mb_unplug_sb(vm, mb_id, 0, count); > > /* > * TODO: Linux MM does not properly clean up yet in all cases > * where adding of memory failed - especially on -ENOMEM. > */ > - if (rc2) > + if (virtio_mem_mb_unplug_sb(vm, mb_id, 0, count)) > new_state = VIRTIO_MEM_MB_STATE_PLUGGED; > virtio_mem_mb_set_state(vm, mb_id, new_state); > return rc; Reviewed-by: Pankaj Gupta