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 AEF0AC433EF for ; Thu, 31 Mar 2022 10:11:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 536A68420C; Thu, 31 Mar 2022 12:10:51 +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="AJM0+yor"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 527BA83C54; Thu, 31 Mar 2022 12:10:07 +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 A60F6841ED for ; Thu, 31 Mar 2022 12:10:00 +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=3-H1FYgYKBiM9RBTKKFNNFKD.BNLT-ANNSKHRSR.CDMW.CD@flex--ascull.bounces.google.com Received: by mail-wr1-x449.google.com with SMTP id i64-20020adf90c6000000b00203f2b5e090so6360384wri.9 for ; Thu, 31 Mar 2022 03:10:00 -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=Bg+fv1bpkm9SSZr3mWpXhyZUF9Sf25mZfzk8/b70wMg=; b=AJM0+yorM1XDNLkCosuMkutMS83xoPrD9gHChW9wYske58V7kj6pe1cGa3qMaDQu2g F0eFRdbI0M6HlwRMRsGtE8+YxCRqivT8gkcPUplOi0pWMWko6AQLy3+pHGeO5kbhjNqe nxDMdGZoU1JvD+iEc210ST49iq/hyvMNxchw/T/D8PcLiA5WUBA/jQ2bTfNCiaww+W3K ued706GdU/b3RIaAJRseIU6UKL4srawifBsLCNZRUM8u+E7y5AqoFrJ4znpASJdkvjcy LmhELsTvXUronmX5IizZ82Fs1ICqpsscVRBUvz6wlOZeF06FAi9OeyfuJKqjvkH7g5ht d5PA== 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=Bg+fv1bpkm9SSZr3mWpXhyZUF9Sf25mZfzk8/b70wMg=; b=LtA4Hj6mdYMDtGJjUc5ZUrvxC1yjYQfg1JN+39SCLHCisRIOlvKjuGKNLhbReudIR/ PriiM8I3vrwMX1Hu9Mdb825/4wEAHRL/mEAAyzGV/rwzUv/1qBGFrQba0uHrhjZ47RNP nVIJE2gOq2N2/MAqJnZgU8gMVWXwT3F/B4ULW/Lx40UKFF4uzLwS0dtNwPQIYwP8F5n4 k9kzlJM2KOaQZ0mebmuiLcNkto1jUbbW6fx0V9O3ipJRuNX3Uct07B4+wSww9Zlfseo3 Mg8VHzuNfI5yydsyCLDAkiOws815rGlV/ZLN2A4E66ZW30nHiiNgzUx/mvyeI8YgHYG7 9HJg== X-Gm-Message-State: AOAM531fQNpD4Ot906iuBic8nii5XFGc378uIS6hOY2jNGJYqhEaSzhB 58JFgGcNEbL0gQ8T0ZPf2jsI8z+fIk7rxUG1oU9lRNfswE+FEsDtFTU6F+vQt/EXrJBE1RGDlTk jkWoNbaQ7+RHjriKbh9cyjSDqWJzHQY3lLtmsILh3phQ/udj1dP8rfL2rYvE= X-Google-Smtp-Source: ABdhPJzwc4cxafs6Os7rgNPCPePD57+ZQusTD1gBYI1FCo/MdMh1WoIu3LPEXR1NkIThbGVCUavpcRg0OrY= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a05:6000:1085:b0:205:ab9b:8cf5 with SMTP id y5-20020a056000108500b00205ab9b8cf5mr3581046wrw.196.1648721400119; Thu, 31 Mar 2022 03:10:00 -0700 (PDT) Date: Thu, 31 Mar 2022 10:09:39 +0000 In-Reply-To: <20220331100949.3637425-1-ascull@google.com> Message-Id: <20220331100949.3637425-2-ascull@google.com> Mime-Version: 1.0 References: <20220331100949.3637425-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1094.g7c7d902a7c-goog Subject: [PATCH 01/11] virtio_ring: Merge identical variables From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, bmeng.cn@gmail.com, adelva@google.com, keirf@google.com, ptosi@google.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 --- 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.1094.g7c7d902a7c-goog