lkml.org 
[lkml]   [2023]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cgroup: cgroup: Remove unnecessary ‘0’ values from ret
Date
ret is assigned first, so it does not need to initialize the assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
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);
--
2.18.2
\
 
 \ /
  Last update: 2023-08-11 11:17    [W:0.059 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site