Skip to content

Commit 1623200

Browse files
committed
cgroup: drop const from @buffer of cftype->write_string()
cftype->write_string() just passes on the writeable buffer from kernfs and there's no reason to add const restriction on the buffer. The only thing const achieves is unnecessarily complicating parsing of the buffer. Drop const from @buffer. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Li Zefan <lizefan@huawei.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Daniel Borkmann <dborkman@redhat.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
1 parent bf9ad08 commit 1623200

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

block/blk-throttle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,13 +1408,13 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft,
14081408
}
14091409

14101410
static int tg_set_conf_u64(struct cgroup_subsys_state *css, struct cftype *cft,
1411-
const char *buf)
1411+
char *buf)
14121412
{
14131413
return tg_set_conf(css, cft, buf, true);
14141414
}
14151415

14161416
static int tg_set_conf_uint(struct cgroup_subsys_state *css, struct cftype *cft,
1417-
const char *buf)
1417+
char *buf)
14181418
{
14191419
return tg_set_conf(css, cft, buf, false);
14201420
}

block/cfq-iosched.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,13 +1701,13 @@ static int __cfqg_set_weight_device(struct cgroup_subsys_state *css,
17011701
}
17021702

17031703
static int cfqg_set_weight_device(struct cgroup_subsys_state *css,
1704-
struct cftype *cft, const char *buf)
1704+
struct cftype *cft, char *buf)
17051705
{
17061706
return __cfqg_set_weight_device(css, cft, buf, false);
17071707
}
17081708

17091709
static int cfqg_set_leaf_weight_device(struct cgroup_subsys_state *css,
1710-
struct cftype *cft, const char *buf)
1710+
struct cftype *cft, char *buf)
17111711
{
17121712
return __cfqg_set_weight_device(css, cft, buf, true);
17131713
}

include/linux/cgroup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ struct cftype {
454454
* Returns 0 or -ve error code.
455455
*/
456456
int (*write_string)(struct cgroup_subsys_state *css, struct cftype *cft,
457-
const char *buffer);
457+
char *buffer);
458458
/*
459459
* trigger() callback can be used to get some kick from the
460460
* userspace, when the actual string written is not important

kernel/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ static int cgroup_procs_write(struct cgroup_subsys_state *css,
21432143
}
21442144

21452145
static int cgroup_release_agent_write(struct cgroup_subsys_state *css,
2146-
struct cftype *cft, const char *buffer)
2146+
struct cftype *cft, char *buffer)
21472147
{
21482148
struct cgroup_root *root = css->cgroup->root;
21492149

kernel/cgroup_freezer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static void freezer_change_state(struct freezer *freezer, bool freeze)
442442
}
443443

444444
static int freezer_write(struct cgroup_subsys_state *css, struct cftype *cft,
445-
const char *buffer)
445+
char *buffer)
446446
{
447447
bool freeze;
448448

kernel/cpuset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
16101610
* Common handling for a write to a "cpus" or "mems" file.
16111611
*/
16121612
static int cpuset_write_resmask(struct cgroup_subsys_state *css,
1613-
struct cftype *cft, const char *buf)
1613+
struct cftype *cft, char *buf)
16141614
{
16151615
struct cpuset *cs = css_cs(css);
16161616
struct cpuset *trialcs;

mm/hugetlb_cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static u64 hugetlb_cgroup_read_u64(struct cgroup_subsys_state *css,
254254
}
255255

256256
static int hugetlb_cgroup_write(struct cgroup_subsys_state *css,
257-
struct cftype *cft, const char *buffer)
257+
struct cftype *cft, char *buffer)
258258
{
259259
int idx, name, ret;
260260
unsigned long long val;

mm/memcontrol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,7 +5242,7 @@ static int memcg_update_kmem_limit(struct mem_cgroup *memcg,
52425242
* RES_LIMIT.
52435243
*/
52445244
static int mem_cgroup_write(struct cgroup_subsys_state *css, struct cftype *cft,
5245-
const char *buffer)
5245+
char *buffer)
52465246
{
52475247
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
52485248
enum res_type type;
@@ -6063,7 +6063,7 @@ static void memcg_event_ptable_queue_proc(struct file *file,
60636063
* Interpretation of args is defined by control file implementation.
60646064
*/
60656065
static int memcg_write_event_control(struct cgroup_subsys_state *css,
6066-
struct cftype *cft, const char *buffer)
6066+
struct cftype *cft, char *buffer)
60676067
{
60686068
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
60696069
struct mem_cgroup_event *event;

net/core/netprio_cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int read_priomap(struct seq_file *sf, void *v)
186186
}
187187

188188
static int write_priomap(struct cgroup_subsys_state *css, struct cftype *cft,
189-
const char *buffer)
189+
char *buffer)
190190
{
191191
char devname[IFNAMSIZ + 1];
192192
struct net_device *dev;

net/ipv4/tcp_memcontrol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val)
103103
}
104104

105105
static int tcp_cgroup_write(struct cgroup_subsys_state *css, struct cftype *cft,
106-
const char *buffer)
106+
char *buffer)
107107
{
108108
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
109109
unsigned long long val;

0 commit comments

Comments
 (0)