From patchwork Thu Nov 12 13:37:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11900241 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 3707E921 for ; Thu, 12 Nov 2020 13:38:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C964622240 for ; Thu, 12 Nov 2020 13:38:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c06GUrPv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C964622240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C60F96B0073; Thu, 12 Nov 2020 08:38:39 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BC40D6B0074; Thu, 12 Nov 2020 08:38:39 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A11BE6B0075; Thu, 12 Nov 2020 08:38:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 6B7F66B0073 for ; Thu, 12 Nov 2020 08:38:39 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0B00C180AD801 for ; Thu, 12 Nov 2020 13:38:39 +0000 (UTC) X-FDA: 77475871158.24.fold73_2e0330827306 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id C0EA01A4A0 for ; Thu, 12 Nov 2020 13:38:38 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,david@redhat.com,,RULES_HIT:30054:30056,0,RBL:63.128.21.124:@redhat.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04yrqpn5twr3csj3r4d8etzbu1yzfoc3pio4w4qp1pgymq6ss3uxue3i5ktbttz.boxz8fowxqyahqjzq9jjwsas8e3fq4pnh1kdy5syscufmjqcg8zncxjkizsc3ek.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:90,LUA_SUMMARY:none X-HE-Tag: fold73_2e0330827306 X-Filterd-Recvd-Size: 3707 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Nov 2020 13:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605188317; 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=d2mSdn7pISMDFqg3U93U8lx3qPnaYzNUm7eZzD9N/i8=; b=c06GUrPvENGF88C6D/+DMn57WY9jeYo7e8Sed3LUIs9zPP1TtN3LpLt+qGoTsA6U8PAQAu tiB1uKmk67OkpGAMrQpwtARUDWH4Nne3YXnZYLEpRSgHzB9O4dxptF/KVzqF9UWo8i56Fa bw2sIiEkbACQ8YSLwLhZzXGNqm2wrF8= 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-446-vAfl626zPMuelm5schgTeQ-1; Thu, 12 Nov 2020 08:38:35 -0500 X-MC-Unique: vAfl626zPMuelm5schgTeQ-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 84316108E1B3; Thu, 12 Nov 2020 13:38:34 +0000 (UTC) Received: from t480s.redhat.com (ovpn-115-61.ams2.redhat.com [10.36.115.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id C553275132; Thu, 12 Nov 2020 13:38:32 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-mm@kvack.org, "Michael S . Tsirkin" , David Hildenbrand , Pankaj Gupta , Wei Yang , Jason Wang Subject: [PATCH v2 04/29] virtio-mem: drop rc2 in virtio_mem_mb_plug_and_add() Date: Thu, 12 Nov 2020 14:37:50 +0100 Message-Id: <20201112133815.13332-5-david@redhat.com> In-Reply-To: <20201112133815.13332-1-david@redhat.com> References: <20201112133815.13332-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We can drop rc2, we don't actually need the value. Reviewed-by: Pankaj Gupta Reviewed-by: Wei Yang 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 0f9d854e8e42..4f18d9855a0e 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -1070,7 +1070,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; @@ -1101,13 +1101,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;