From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 129A5C433F5 for ; Wed, 13 Apr 2022 14:21:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 168CE83DA7; Wed, 13 Apr 2022 16:21:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="lD21uVmZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D18F83D61; Wed, 13 Apr 2022 16:21:49 +0200 (CEST) Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C546183C97 for ; Wed, 13 Apr 2022 16:21:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3etxWYgYKBqcHZJbSSNVVNSL.JVTb-IVVaSPZaZ.KLUe.KL@flex--ascull.bounces.google.com Received: by mail-wr1-x449.google.com with SMTP id 65-20020adf8147000000b00207982c3692so417465wrm.15 for ; Wed, 13 Apr 2022 07:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=xd639xdLQ47a1zxmSU9t276fxMTzRcgCExdTQ2ozW24=; b=lD21uVmZd8j1QvZntivxGgdYa4FygYOSCXt12IVC0ff9p4ywgOGh2k4M5PfydMsl/s MF4Vul3iXws4T7PkWjqJ6gckYeNwVOWptNobEE7jE4uIYJnLK3bkLGinY7q8MW1lt/Qc kZ6I1LGeAPPhMuzwRxFuMzv+u1GmOsvy236l08jIepPIFTeKVPlaReUGBgPl5JQ51J1/ 9/+0QO9lgaXB3MsBqWYde6YlURHyCmCgecocoZRXqOvEpsaPoW4/tnf5O+breNOEGH1O tvFy250m+ZZ2uybuRGJ24EUvuwhjWhrjWUdikD07OEBdeEqE3DJ64+tzzMNbGq9rDHmD OVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=xd639xdLQ47a1zxmSU9t276fxMTzRcgCExdTQ2ozW24=; b=bRL4oSJf2hNHKydX+P0SoE4HIB+ETs7s3NmViY52P8Tl4p6XET7/Dz+7BA+fqyVkIM kuxVaZBA0wliLF4EDBkHSTdwJhU5/0QqbJPeXVB1OahF/ebndJ1W4paN9gF7J7Cfe9l+ P9pIS/kP/TKsxP7C0E6yShpS7hKb3jPG5FolfBx/PTWw7oiIFaj6dU61cQwJWgUpBKVs y8/iem4MXdqacZxQmk6xy5nCq9CoQ1HNGWI9WxW/Ni5uv1fxpz+qcSOmUxX37Ov9/c1v U7uvL3UkHz8Jm7ne0hM8Ob6cYSY4HdGLVsyDWm546R4dMLVGByk7IKU0V/KWRtH/3YQ0 180g== X-Gm-Message-State: AOAM532wR64FMpHk2hSsOjqdYxZwZABJV0pd5QE4TWzLCaNsbGjDnsyo b9KUwBXTKaBS945utt5/zT3T0PK+Dy8CPy0kDWx0AyuCOlxYiBxdB0UQZKKTWq3dcOt30OhzJKm 97PXIci1tj4H63siDD2bS2wOR+oT6f9cY3XUOkvDcI5/oy3GiImDkDCCPTQM= X-Google-Smtp-Source: ABdhPJxdLULlhu9BiOfTMP3Cey2MKf2A3Q+xwjwBp/9/m65joN1Ua5He0X68aZ00xBcu0CVPT6Pkg0Eu0RQ= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a7b:c341:0:b0:37b:c619:c9f4 with SMTP id l1-20020a7bc341000000b0037bc619c9f4mr8868795wmj.38.1649859706365; Wed, 13 Apr 2022 07:21:46 -0700 (PDT) Date: Wed, 13 Apr 2022 14:21:26 +0000 In-Reply-To: <20220413142137.560987-1-ascull@google.com> Message-Id: <20220413142137.560987-2-ascull@google.com> Mime-Version: 1.0 References: <20220413142137.560987-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH v2 01/12] virtio_ring: Merge identical variables From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The variables `total_sg` and `descs_used` have the same value. Replace the few uses of `total_sg` with `descs_used` to simplify the situation. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_ring.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 7f1cbc5932..a6922ce1b8 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -20,17 +20,16 @@ int virtqueue_add(struct virtqueue *vq, struct virtio_sg *sgs[], unsigned int out_sgs, unsigned int in_sgs) { struct vring_desc *desc; - unsigned int total_sg = out_sgs + in_sgs; - unsigned int i, n, avail, descs_used, uninitialized_var(prev); + unsigned int descs_used = out_sgs + in_sgs; + unsigned int i, n, avail, uninitialized_var(prev); int head; - WARN_ON(total_sg == 0); + WARN_ON(descs_used == 0); head = vq->free_head; desc = vq->vring.desc; i = head; - descs_used = total_sg; if (vq->num_free < descs_used) { debug("Can't add buf len %i - avail = %i\n", -- 2.35.1.1178.g4f1659d476-goog