Skip to content

Commit 52e039f

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Remove unneeded goto in sched_partition_write() and rename it
The goto statement in sched_partition_write() is not needed. Remove it and rename sched_partition_write()/sched_partition_show() to cpuset_partition_write()/cpuset_partition_show(). Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent f0a0bd3 commit 52e039f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

kernel/cgroup/cpuset.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,7 +3272,7 @@ int cpuset_common_seq_show(struct seq_file *sf, void *v)
32723272
return ret;
32733273
}
32743274

3275-
static int sched_partition_show(struct seq_file *seq, void *v)
3275+
static int cpuset_partition_show(struct seq_file *seq, void *v)
32763276
{
32773277
struct cpuset *cs = css_cs(seq_css(seq));
32783278
const char *err, *type = NULL;
@@ -3303,7 +3303,7 @@ static int sched_partition_show(struct seq_file *seq, void *v)
33033303
return 0;
33043304
}
33053305

3306-
static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
3306+
static ssize_t cpuset_partition_write(struct kernfs_open_file *of, char *buf,
33073307
size_t nbytes, loff_t off)
33083308
{
33093309
struct cpuset *cs = css_cs(of_css(of));
@@ -3324,11 +3324,8 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
33243324
css_get(&cs->css);
33253325
cpus_read_lock();
33263326
mutex_lock(&cpuset_mutex);
3327-
if (!is_cpuset_online(cs))
3328-
goto out_unlock;
3329-
3330-
retval = update_prstate(cs, val);
3331-
out_unlock:
3327+
if (is_cpuset_online(cs))
3328+
retval = update_prstate(cs, val);
33323329
mutex_unlock(&cpuset_mutex);
33333330
cpus_read_unlock();
33343331
css_put(&cs->css);
@@ -3372,8 +3369,8 @@ static struct cftype dfl_files[] = {
33723369

33733370
{
33743371
.name = "cpus.partition",
3375-
.seq_show = sched_partition_show,
3376-
.write = sched_partition_write,
3372+
.seq_show = cpuset_partition_show,
3373+
.write = cpuset_partition_write,
33773374
.private = FILE_PARTITION_ROOT,
33783375
.flags = CFTYPE_NOT_ON_ROOT,
33793376
.file_offset = offsetof(struct cpuset, partition_file),

0 commit comments

Comments
 (0)