Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp159923pxj; Wed, 23 Jun 2021 18:36:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAC6NyLUoLrs878jJBn2stU/3UH2rOsOgNy4K9fEQIWx9bjOqcsOn8PPlSkB5EnHsCOhCJ X-Received: by 2002:aa7:dcd5:: with SMTP id w21mr3476957edu.144.1624498603504; Wed, 23 Jun 2021 18:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624498603; cv=none; d=google.com; s=arc-20160816; b=0jLJxhO+sRYyeNoCme+DmdoajkXzQaYGxxQGx4XvSWMBLVLDNwndjB8HJn1nKsl1Xo zBE3X9Lm0yNSLRu1aKi+rVpn+pmwYVZURyck5PEpsvcz5Wr/R7vA/dMo99ALb2N4yKQL bFzWPlHcHkxrUd+Ea6QCC7c9YXDYj1aYbIA4p0MblKOmtoACayEpAKxCkWSg/SmA4m0E 0hwNaxUoOByfDDd3OLC3Qps/ssDR4OTquK/Z6ZgXX3t+/iFbR+xubwH/QVbCARXrsRnB YA1jWEBcENKSScuUzsE15UThuJwEljlBHib8IuZg9MstVW1u3soahDmbOeTGoPbb0qqf PAXA== 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=Ckt1TCdFVW7EDBaIXqCNOGP8eAtJo6AaE1TsGK+Xuntv3Lwu2Jcqrly0bavmzbjSco ddkmRLLzZ1IKe1IVPy/W+mwcIv6Q8svfjHo10gBwIRhbtWJX6598dWVvzi40o1vdScAC x/8R91aNez7N1ZdVCPSm5jIwO08HxY2NkFpYerYyV8aesD5aeRMI4GYjQOblVWH0uGAa JXbnJVyf8+SVqunSnx4e+y1aH5t3kgHDIIv7iGwYwcjQQAsQz5+GqOpKnHjmbzRFZKMJ tJeEd29VsT9yXyjxywikZjD7WJkyiqK3h/N3S9Cit98GLzeA/fiCiL60db2Yi9vhugzI Y8IA== 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 bm1si1387807edb.395.2021.06.23.18.35.54; Wed, 23 Jun 2021 18:36:43 -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 S229796AbhFXBfr (ORCPT + 99 others); Wed, 23 Jun 2021 21:35:47 -0400 Received: from mx20.baidu.com ([111.202.115.85]:41778 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229758AbhFXBfr (ORCPT ); Wed, 23 Jun 2021 21:35:47 -0400 X-Greylist: delayed 917 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 Jun 2021 21:35:46 EDT Received: from BC-Mail-Ex12.internal.baidu.com (unknown [172.31.51.52]) by Forcepoint Email with ESMTPS id BFC658B1C1A00E2B8333; Thu, 24 Jun 2021 09:18:04 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex12.internal.baidu.com (172.31.51.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.10; Thu, 24 Jun 2021 09:18:04 +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; Thu, 24 Jun 2021 09:18:04 +0800 From: Cai Huoqing To: , , , CC: , , , , Cai Huoqing Subject: [PATCH v2] virtio_net/vringh: add "else { }" according coding style Date: Thu, 24 Jun 2021 09:17:57 +0800 Message-ID: <20210624011757.338-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-Ex11.internal.baidu.com (172.31.51.51) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) 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