Skip to content

Commit c9dadee

Browse files
committed
cgroup/cpuset: Remove unneeded goto in sched_partition_write() and rename it
JIRA: https://issues.redhat.com/browse/RHEL-107751 commit 52e039f Author: Waiman Long <longman@redhat.com> Date: Sun, 30 Mar 2025 17:52:45 -0400 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> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 887fbea commit c9dadee

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
@@ -3295,7 +3295,7 @@ int cpuset_common_seq_show(struct seq_file *sf, void *v)
32953295
return ret;
32963296
}
32973297

3298-
static int sched_partition_show(struct seq_file *seq, void *v)
3298+
static int cpuset_partition_show(struct seq_file *seq, void *v)
32993299
{
33003300
struct cpuset *cs = css_cs(seq_css(seq));
33013301
const char *err, *type = NULL;
@@ -3326,7 +3326,7 @@ static int sched_partition_show(struct seq_file *seq, void *v)
33263326
return 0;
33273327
}
33283328

3329-
static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
3329+
static ssize_t cpuset_partition_write(struct kernfs_open_file *of, char *buf,
33303330
size_t nbytes, loff_t off)
33313331
{
33323332
struct cpuset *cs = css_cs(of_css(of));
@@ -3347,11 +3347,8 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
33473347
css_get(&cs->css);
33483348
cpus_read_lock();
33493349
mutex_lock(&cpuset_mutex);
3350-
if (!is_cpuset_online(cs))
3351-
goto out_unlock;
3352-
3353-
retval = update_prstate(cs, val);
3354-
out_unlock:
3350+
if (is_cpuset_online(cs))
3351+
retval = update_prstate(cs, val);
33553352
mutex_unlock(&cpuset_mutex);
33563353
cpus_read_unlock();
33573354
css_put(&cs->css);
@@ -3395,8 +3392,8 @@ static struct cftype dfl_files[] = {
33953392

33963393
{
33973394
.name = "cpus.partition",
3398-
.seq_show = sched_partition_show,
3399-
.write = sched_partition_write,
3395+
.seq_show = cpuset_partition_show,
3396+
.write = cpuset_partition_write,
34003397
.private = FILE_PARTITION_ROOT,
34013398
.flags = CFTYPE_NOT_ON_ROOT,
34023399
.file_offset = offsetof(struct cpuset, partition_file),

0 commit comments

Comments
 (0)