Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5425210pxj; Wed, 23 Jun 2021 00:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrYzFDkqxpo7wC4mMfQ9uAB2E6oX1UaTqRwqYpZG+S/v3y/dHq09UGgipXJR0dXJ2tcyfi X-Received: by 2002:a05:6402:220d:: with SMTP id cq13mr4503347edb.214.1624433784050; Wed, 23 Jun 2021 00:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624433784; cv=none; d=google.com; s=arc-20160816; b=iDPAnprDh0oRSHxVBKbxFz23OraQqCDgdoJa6bvVzEAwnvdHCL+3/U+kilqh4RJ3Ky hgknMtgLXz8iYbBYF44HcjtcDZKqyAz8nD3ouuM+1Ho7yyQ3uCOH+QKKaq2kj3tnOY9Y UGa0lWJb1lK5wt1DeGxkC4sa6OyUPxyAHeTsZliAZwNfQK4tPaKpl+Lhjvhiop1lHYyF VgFvRMUQtd41e5Xp5jMA5dzDMwOZArY6O7Myi6mw4xEUpkPfY8468MtbfvnqCNwk0DKx 9AATsF0fkYxngYVO6/4FhikOYNA++6WuPLhgu31ccoNhqveeKU78Go9rmMIXwsA883Rx avUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=KhFHSw7WJtx9Rmw8wwrEvNHTu2DBAXi4xMG5kQ7rGZM=; b=YvNYLWjtRUIriH3+/aVvlqc4oqa2gVznYBPztFBsmWd4EDMfNNdhvNQdObimgnu/Bg lmgftjGWKAeZcyc2cinBtgWJdYeVsY2qkMJnyr3EOxSc0Nuh22eC+YZmKkgCkjU9mlZ9 5nzDW76tw1V4c38oI7ICZvel6t1iHKwD+7mxiTCC4w8OWa0jzRuYjuubysD7UPc4CbQo 1AkipAf+XN96VL/bLuvY0m0gr4b/mAfPZak+RMAgCzaQGXWccvNUJCbSZlp/3E0sF+nC rypoFv0dnHfDh9p1wANzPtADvoGMe5OXB+vG7V1J5wgfHywsiL89xFI7U/3WTID+nQdB AjPQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si14327937edv.482.2021.06.23.00.36.00; Wed, 23 Jun 2021 00:36:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhFWHfV (ORCPT + 99 others); Wed, 23 Jun 2021 03:35:21 -0400 Received: from mx21.baidu.com ([220.181.3.85]:56666 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229864AbhFWHfT (ORCPT ); Wed, 23 Jun 2021 03:35:19 -0400 Received: from BJHW-Mail-Ex09.internal.baidu.com (unknown [10.127.64.32]) by Forcepoint Email with ESMTPS id 27950A13896BCEE60EDB; Wed, 23 Jun 2021 15:32:52 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.4; Wed, 23 Jun 2021 15:32:52 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.4; Wed, 23 Jun 2021 15:32:51 +0800 From: Cai Huoqing To: , , , CC: , , , , Cai Huoqing Subject: [PATCH] add "else {...}" according coding style Date: Wed, 23 Jun 2021 15:32:43 +0800 Message-ID: <20210623073243.876-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex16.internal.baidu.com (172.31.51.56) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex09_2021-06-23 15:32:52:172 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org coding-style.rst shows that: if (condition) { do_this(); do_that(); } else { otherwise(); } Signed-off-by: Cai Huoqing --- drivers/net/virtio_net.c | 3 ++- drivers/vhost/vringh.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 21ff7b9e49c2..7cd062cb468e 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -314,8 +314,9 @@ static struct page *get_a_page(struct receive_queue *rq, gfp_t gfp_mask) rq->pages = (struct page *)p->private; /* clear private here, it is used to chain pages */ p->private = 0; - } else + } else { p = alloc_page(gfp_mask); + } return p; } diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 4af8fa259d65..79542cad1072 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -454,8 +454,9 @@ static inline int __vringh_complete(struct vringh *vrh, if (!err) err = putused(vrh, &used_ring->ring[0], used + part, num_used - part); - } else + } else { err = putused(vrh, &used_ring->ring[off], used, num_used); + } if (err) { vringh_bad("Failed to write %u used entries %u at %p", -- 2.17.1