Skip to content

Commit

Permalink
cgroup: drop const from @buffer of cftype->write_string()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
htejun committed Mar 13, 2014
1 parent bf9ad08 commit 1623200
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,13 +1408,13 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft,
}

static int tg_set_conf_u64(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buf)
char *buf)
{
return tg_set_conf(css, cft, buf, true);
}

static int tg_set_conf_uint(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buf)
char *buf)
{
return tg_set_conf(css, cft, buf, false);
}
Expand Down
4 changes: 2 additions & 2 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,13 +1701,13 @@ static int __cfqg_set_weight_device(struct cgroup_subsys_state *css,
}

static int cfqg_set_weight_device(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buf)
struct cftype *cft, char *buf)
{
return __cfqg_set_weight_device(css, cft, buf, false);
}

static int cfqg_set_leaf_weight_device(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buf)
struct cftype *cft, char *buf)
{
return __cfqg_set_weight_device(css, cft, buf, true);
}
Expand Down
2 changes: 1 addition & 1 deletion include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ struct cftype {
* Returns 0 or -ve error code.
*/
int (*write_string)(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buffer);
char *buffer);
/*
* trigger() callback can be used to get some kick from the
* userspace, when the actual string written is not important
Expand Down
2 changes: 1 addition & 1 deletion kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ static int cgroup_procs_write(struct cgroup_subsys_state *css,
}

static int cgroup_release_agent_write(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buffer)
struct cftype *cft, char *buffer)
{
struct cgroup_root *root = css->cgroup->root;

Expand Down
2 changes: 1 addition & 1 deletion kernel/cgroup_freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static void freezer_change_state(struct freezer *freezer, bool freeze)
}

static int freezer_write(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buffer)
char *buffer)
{
bool freeze;

Expand Down
2 changes: 1 addition & 1 deletion kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
* Common handling for a write to a "cpus" or "mems" file.
*/
static int cpuset_write_resmask(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buf)
struct cftype *cft, char *buf)
{
struct cpuset *cs = css_cs(css);
struct cpuset *trialcs;
Expand Down
2 changes: 1 addition & 1 deletion mm/hugetlb_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static u64 hugetlb_cgroup_read_u64(struct cgroup_subsys_state *css,
}

static int hugetlb_cgroup_write(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buffer)
struct cftype *cft, char *buffer)
{
int idx, name, ret;
unsigned long long val;
Expand Down
4 changes: 2 additions & 2 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5242,7 +5242,7 @@ static int memcg_update_kmem_limit(struct mem_cgroup *memcg,
* RES_LIMIT.
*/
static int mem_cgroup_write(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buffer)
char *buffer)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
enum res_type type;
Expand Down Expand Up @@ -6063,7 +6063,7 @@ static void memcg_event_ptable_queue_proc(struct file *file,
* Interpretation of args is defined by control file implementation.
*/
static int memcg_write_event_control(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buffer)
struct cftype *cft, char *buffer)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
struct mem_cgroup_event *event;
Expand Down
2 changes: 1 addition & 1 deletion net/core/netprio_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static int read_priomap(struct seq_file *sf, void *v)
}

static int write_priomap(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buffer)
char *buffer)
{
char devname[IFNAMSIZ + 1];
struct net_device *dev;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/tcp_memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val)
}

static int tcp_cgroup_write(struct cgroup_subsys_state *css, struct cftype *cft,
const char *buffer)
char *buffer)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
unsigned long long val;
Expand Down
4 changes: 2 additions & 2 deletions security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ static inline bool has_children(struct dev_cgroup *devcgroup)
* parent cgroup has the access you're asking for.
*/
static int devcgroup_update_access(struct dev_cgroup *devcgroup,
int filetype, const char *buffer)
int filetype, char *buffer)
{
const char *b;
char temp[12]; /* 11 + 1 characters needed for a u32 */
Expand Down Expand Up @@ -652,7 +652,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
}

static int devcgroup_access_write(struct cgroup_subsys_state *css,
struct cftype *cft, const char *buffer)
struct cftype *cft, char *buffer)
{
int retval;

Expand Down

0 comments on commit 1623200

Please sign in to comment.