Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp66561rwe; Tue, 30 Aug 2022 21:14:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR6wCl32+CeGR0srRbUY2N7Q9tq3Z4Qd2/LAy/4xQvrh7izsvDfuWK31a8CVTADyRVr0sArL X-Received: by 2002:a17:907:802:b0:73d:c710:943e with SMTP id wv2-20020a170907080200b0073dc710943emr18803195ejb.214.1661919285846; Tue, 30 Aug 2022 21:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661919285; cv=none; d=google.com; s=arc-20160816; b=mltzkKAh3QE10MqwcO1o1Djr9ZGi8S6UJA4WGq+IBgqUnxBPvwuDJ3H7Z1JDBpPzwR Avf5t2w7BZAbVf/PaNNiGWwWhNCP41qmK+2BJ27JF0fB+i/+ZHIjp+ahaEkHXiVVZAf5 I9zz8FE9yA9jjjlGa2JNpOSWuYk8MbpCbk+nzHqAm+ckGlV5lGZMNrnBAOI3IxJGjvnj YpEpuncJZIvrye47EbwPgg2HUUJ2WBUaFZhGSoXo5Tcd2/lwXTejz1HwilJHRsnkynbj gmSZ0Z8pAtuc2XJGf3P+GJPDBLJmdi4COHw6MJcqbFR5T4TfQO5bYnISSBANb92oz6DW s5aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=X+ZGlyTBwZt0DeOrHN59b2QlgcVu7kBwVFS+fIlcSNU=; b=ovhB0dEIar2KyVNYvUD5YVh+CZk3mafd5tIhagiOkxKVfT4lnBnDkowOsCSuNQCvJ5 Sf9zuWFmVIt+X4zgoHcUQFfeewAdI9CYGjQLUBlu62d2eOawUkEuWjHNXBZqEi9+jNh8 6fmDDksOKXh4o6HWx4cVAEZqfRPN9sAoedEloEedwQAMm6eVCzdJT8LHjFxs3a9Sewof 68Sir8rJPNe04y/r8bW5RpisK2APIHAppW+0qOL34bBCGV/txFAikfRvrKBFBZtBkz6K vd5ahigmMLHAG3IoNTW1dCBJYwun9o7eTUAlprjGAv27Kyql4GwYGqlbmggLC/J0GS7C QTsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a1709062b0700b0073dd64bef00si8199457ejg.929.2022.08.30.21.14.18; Tue, 30 Aug 2022 21:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbiHaEKN (ORCPT + 99 others); Wed, 31 Aug 2022 00:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiHaEKK (ORCPT ); Wed, 31 Aug 2022 00:10:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 937AA28E24; Tue, 30 Aug 2022 21:10:04 -0700 (PDT) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MHVwt4c5nzlWZk; Wed, 31 Aug 2022 12:06:38 +0800 (CST) Received: from ubuntu-82.huawei.com (10.175.104.82) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 31 Aug 2022 12:10:02 +0800 From: Ziyang Xuan To: , , , , , CC: Subject: [PATCH next-next 2/2] net: vlan: reduce indentation level in __vlan_find_dev_deep_rcu() Date: Wed, 31 Aug 2022 12:09:57 +0800 Message-ID: <917c41381e1155eefe84c610585c487d8073166f.1661916732.git.william.xuanziyang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.82] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If vlan_info is NULL in __vlan_find_dev_deep_rcu(), else { ... } is unnecessary. Remove it to reduce indentation level. Signed-off-by: Ziyang Xuan --- net/8021q/vlan_core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 5aa8144101dc..027d4ebed9c0 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -77,23 +77,19 @@ struct net_device *__vlan_find_dev_deep_rcu(struct net_device *dev, __be16 vlan_proto, u16 vlan_id) { struct vlan_info *vlan_info = rcu_dereference(dev->vlan_info); + struct net_device *upper_dev; - if (vlan_info) { + if (vlan_info) return vlan_group_get_device(&vlan_info->grp, vlan_proto, vlan_id); - } else { - /* - * Lower devices of master uppers (bonding, team) do not have - * grp assigned to themselves. Grp is assigned to upper device - * instead. - */ - struct net_device *upper_dev; - upper_dev = netdev_master_upper_dev_get_rcu(dev); - if (upper_dev) - return __vlan_find_dev_deep_rcu(upper_dev, - vlan_proto, vlan_id); - } + /* Lower devices of master uppers (bonding, team) do not have + * grp assigned to themselves. Grp is assigned to upper device + * instead. + */ + upper_dev = netdev_master_upper_dev_get_rcu(dev); + if (upper_dev) + return __vlan_find_dev_deep_rcu(upper_dev, vlan_proto, vlan_id); return NULL; } -- 2.25.1