From patchwork Sun Aug 13 01:47:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 134391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp979133vqi; Fri, 11 Aug 2023 03:10:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFssyO2dfJKsJ90dnTX9o6Z2MNFK7WnkRwLfsJwvvwr9CcmiVq/om/TTo9DCc4mSOW12T1j X-Received: by 2002:aa7:c2d3:0:b0:523:4996:a4f9 with SMTP id m19-20020aa7c2d3000000b005234996a4f9mr1286368edp.34.1691748624294; Fri, 11 Aug 2023 03:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691748624; cv=none; d=google.com; s=arc-20160816; b=fkyq5JYsxxgqL2owsGNn+ijEb5GcJ6/fKe2ye4XUrY+ACY0k1Q28J1JhtmR0u+UrcQ SAbOsl71D/+tY0joDEC8H703saagWqms9vbErkocz2cUOV1qIRshfA1dZmFIpgy1o4mI 5wJI+NNrU1kfiehL8LxY9PYnuv1YJNMEWeNnZI4z7S1VGF4MzI2I2JouTyttxkkqWKUp iSVltRCZZRdOaf2+TuUmDrKigGZXneS1C7eweuwOZR024IUmImmHSzWfYtL8xPN8qMTw P1gPse1Zl2QeLTBFrhMpmx1cDc8LMEW2bOvYaO/8sl/JUtVDKIKpTxgL9ZQfmqDAc5dR srjg== 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; bh=PuMsgiwQadyMTlLrgCyFavGQOnrfKi0fvuGypev1X0k=; fh=3vtYlIUzX5mvgfEsHX1c04bXxEfZZPfgCfm1sZQSCmc=; b=aZXNra9g8N04nYfs5XWW8zX6nRNM80QDlql2JnaY9bpGw7H4hLhwRnaVfJ2OzJ74hx 3W4nuZwoDu2oCE+4HsbUGqxQoZKQpiTezvVq5dS/D2PRb9d9HvlUL7TLv5pNTUPpcS9u ttg/ONFAc8/tKoF2Ki4CRgZbt4ECGuyNl/ERV3grTuSbuimjpHzSFmQk1cniBxnMyA7+ k/UxFk3J8DMHho+7wvSKMNHxm4z8VoSMjha/80/bDtGvbsyqiWTCXAltSbJwXU5tbQQY qlmUJJ9nMPQvy4ThgZ7ca1GxFPAYv3xj/kR14ml0CUQ51/YeA6hYpISH64QdTxksWvfg 0J0Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020aa7de0b000000b005223c32fd2asi3047774edv.570.2023.08.11.03.10.00; Fri, 11 Aug 2023 03:10:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234852AbjHKJQc (ORCPT + 99 others); Fri, 11 Aug 2023 05:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234802AbjHKJQ0 (ORCPT ); Fri, 11 Aug 2023 05:16:26 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id EFDEB2D5B; Fri, 11 Aug 2023 02:16:24 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 46D96605E83D9; Fri, 11 Aug 2023 17:16:15 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?cgroup=3A_cgroup=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Sun, 13 Aug 2023 09:47:34 +0800 Message-Id: <20230813014734.2916-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773927005293497829 X-GMAIL-MSGID: 1773927005293497829 ret is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li kunyu --- kernel/cgroup/cgroup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index f55a40db065f..cdda2a147d6b 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2859,7 +2859,7 @@ int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, { DEFINE_CGROUP_MGCTX(mgctx); struct task_struct *task; - int ret = 0; + int ret; /* look up all src csets */ spin_lock_irq(&css_set_lock); @@ -3945,7 +3945,7 @@ static void cgroup_kill(struct cgroup *cgrp) static ssize_t cgroup_kill_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { - ssize_t ret = 0; + ssize_t ret; int kill; struct cgroup *cgrp; @@ -5083,7 +5083,7 @@ static int cgroup_attach_permissions(struct cgroup *src_cgrp, struct super_block *sb, bool threadgroup, struct cgroup_namespace *ns) { - int ret = 0; + int ret; ret = cgroup_procs_write_permission(src_cgrp, dst_cgrp, sb, ns); if (ret) @@ -5921,7 +5921,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) int cgroup_rmdir(struct kernfs_node *kn) { struct cgroup *cgrp; - int ret = 0; + int ret; cgrp = cgroup_kn_lock_live(kn, false); if (!cgrp) @@ -6995,7 +6995,7 @@ static ssize_t delegate_show(struct kobject *kobj, struct kobj_attribute *attr, { struct cgroup_subsys *ss; int ssid; - ssize_t ret = 0; + ssize_t ret; ret = show_delegatable_files(cgroup_base_files, buf + ret, PAGE_SIZE - ret, NULL);