Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp29158rwb; Fri, 16 Sep 2022 23:43:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eW9hxphrNV37gDFw1X7q+VXQWt7Rcih7k3n3UI//fQP+oBAFzyb/NzUr9i24r8BJE3P8y X-Received: by 2002:a17:90b:4d0e:b0:1f7:ae99:4d7f with SMTP id mw14-20020a17090b4d0e00b001f7ae994d7fmr19746915pjb.200.1663397003108; Fri, 16 Sep 2022 23:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663397003; cv=none; d=google.com; s=arc-20160816; b=yJa4H9PtBwpRAltJ/aCIka8yZNFndXY5Uggx9RkLCOXdQC1cqmLED9QoqP+62IOoYn j8JsJ2FzTY7spez+J6IoV/qjvvBB2IJ0aZASm9tyhdu1eHXiMwxxZfEMMITSAnIDHSin sn0Oxz0SrdPNzjYEPtzhLWLGkIisBcaWDDHJlsebzbx/87wED9jt3beH9wUiJhhmOeUv 1DyrKn1JJXBGQJMCa3q66gDdCxFq9rQtQIm20N53CzOuuUCmZTQh+7vaoN0bey1UHQC5 XerwzE8aFMtwEhQZOkKQZqFu1MI6lHBUGcTqBuZJgtAHhke/I/QtkWLlDbQgDthFfHbi 9IqA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Sk8f4Kor53nWiBGSEmFzBqgX0mraGX2YhwieIB+TDYs=; b=nimCjEdByG3SAlGq+BbZOQfgcy9Dwy/TR72nNgmPEXkwSqAb2YQCj3EVIj4qovibAL jy/+Yo+3KyesjoaPM+LQ/kIk8ZINu4C2Ud5FF1gt2QrEmuKR0l+z8+UOyiwI93yFeI3J SdEEqw/bJ+H7eZmIm5P28a0jPG6wb5pFfbyynMLulB5o4vfkQJASRvoKLXjgrjR8lF1y Wqz7HckKPxtXl4ZiYaSXys8PhKVuFokGCiti+VSCNIyAZAd58k/3DJN2px2NlHOWvEPB V2NTKYfpVqZPjYFpO/C0A60o1WTLfh7KxUVPdyRo93L1A1PNu2kRmK8fSRSJu1dK8qZ0 pW7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=NxzlnFNp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o67-20020a17090a0a4900b0020265d5b786si4108209pjo.164.2022.09.16.23.43.11; Fri, 16 Sep 2022 23:43:23 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=NxzlnFNp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbiIQGhe (ORCPT + 99 others); Sat, 17 Sep 2022 02:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiIQGhc (ORCPT ); Sat, 17 Sep 2022 02:37:32 -0400 Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BFED4D804; Fri, 16 Sep 2022 23:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Sk8f4 Kor53nWiBGSEmFzBqgX0mraGX2YhwieIB+TDYs=; b=NxzlnFNpobHkDsGao33WU LxW+U3LWG00FRtuIgiqlzlH4sUD6nWwbDUL5l2GDjyEkJafxyPjsTjmPxIFF31cO tpecLU288sIBeCf5u3fFRtTjYpbfCeQ21GS+c3qyZWLJFjQS+EsSQupL6HFxSRUK dDaQg4tvmmA7sjIZ1Hpev4= Received: from DESKTOP-CE2KKHI.localdomain (unknown [124.160.210.227]) by smtp1 (Coremail) with SMTP id GdxpCgDHzp7OaiVj3yvhdQ--.64650S2; Sat, 17 Sep 2022 14:35:59 +0800 (CST) From: williamsukatube@163.com To: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: William Dean Subject: [PATCH -next] net: sched: simplify code in mall_reoffload Date: Sat, 17 Sep 2022 14:35:56 +0800 Message-Id: <20220917063556.2673-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GdxpCgDHzp7OaiVj3yvhdQ--.64650S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF17KFy5Gr4UuF4fJr17trb_yoW3Arg_Ca 48Xr4xWFn7JF1UG3yIqr4vy34SqFZFvFWYqrs2grW7Ga18KF4kZan8K3Z5ArZ3WryxtF1U CrZY9Fy5Cr47ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_byZUUUUUU== X-Originating-IP: [124.160.210.227] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/xtbBiA9-g1aECq0sqgAAsI X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: William Dean such expression: if (err) return err; return 0; can simplify to: return err; Signed-off-by: William Dean --- net/sched/cls_matchall.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 06cf22adbab7..63b99ffb7dbc 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -313,10 +313,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb, tc_cleanup_offload_action(&cls_mall.rule->action); kfree(cls_mall.rule); - if (err) - return err; - - return 0; + return err; } static void mall_stats_hw_filter(struct tcf_proto *tp, -- 2.25.1