cgroup: drop const from @buffer of cftype->write_string()
authorTejun Heo <tj@kernel.org>
Wed, 19 Mar 2014 14:23:54 +0000 (10:23 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 19 Mar 2014 14:23:54 +0000 (10:23 -0400)
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>
Acked-by: 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>
block/blk-throttle.c
block/cfq-iosched.c
include/linux/cgroup.h
kernel/cgroup.c
kernel/cgroup_freezer.c
kernel/cpuset.c
mm/hugetlb_cgroup.c
mm/memcontrol.c
net/core/netprio_cgroup.c
net/ipv4/tcp_memcontrol.c
security/device_cgroup.c

index 861c363e412914f4d4a9b53655089adaa7d91ee0..033745cd7fba62b299301860f4ee0f50ec2ff04e 100644 (file)
@@ -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);
 }
index 461187943392e96d5db9a50327fad3e9239eed31..f5de45b6af36bf05f01a34a3790ba9f8e11cbadc 100644 (file)
@@ -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);
 }
index 77294fc66603069c091508f4e17f3a19f6ff8edf..79993ac066c52ad94a4193ba41b4ff8593bd9d60 100644 (file)
@@ -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
index 60ea16058c420fd2fa2e0da35b1a460ef75f3dd1..f5754910e80bbd12b55257dfa6658ff0b23a60d4 100644 (file)
@@ -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;
 
index 2ea98b216bff56a21aaec5fc974c3ca0d9ac1671..2bc4a2256444ebf500269c5dc276871e48e0efa8 100644 (file)
@@ -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;
 
index 8d5324583aa4d52db06aa61466e3e73d79ad37e5..efbf9baf77ec8425c2d5d14a61afc5cf0e28b181 100644 (file)
@@ -1610,7 +1610,7 @@ out_unlock:
  * 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;
index b135853e68f3134b79a5b4a3e03c13b1b9999d29..595d7fd795e168e1c38205f2a4d5703f49068399 100644 (file)
@@ -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;
index d9c6ac1532e64a0dd06be9f36859c35551a15ccc..96f94a9f2faf0f2bbccbdf06a52631193e434eba 100644 (file)
@@ -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;
@@ -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;
index f9f3a40d3350e8f7ecd731c2c9ddbd226973a170..3825f669147b429dc10efe2204c1b7523092c66c 100644 (file)
@@ -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;
index 20a0aca9131edfec97eab77437225ad9698b3b02..d4f015ad6c841ddcc4c4327eb4ccf2ad49697dff 100644 (file)
@@ -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;
index 7f88bcde7c61a42d355e81ead4719f86bab27630..8365909f5f8cfc6f404fe5ce21b936884298d13f 100644 (file)
@@ -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 */
@@ -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;