* [PATCH 2/6] cgroup: Fix line length to 80 characters
[not found] ` <1450182045-27480-1-git-send-email-kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-12-15 12:20 ` Jakub Kunert
[not found] ` <1450182045-27480-2-git-send-email-kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-15 12:20 ` [PATCH 3/6] cgroup: Fix trailing */ in block comments Jakub Kunert
` (5 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Jakub Kunert @ 2015-12-15 12:20 UTC (permalink / raw)
To: tj-DgEjT+Ai2ygdnm+yROfE0A; +Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, Jakub Kunert
Fix checkpatch.pl warnings with lines over 80 characters.
Signed-off-by: Jakub Kunert <kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
kernel/cgroup.c | 51 ++++++++++++++++++++++++++++++++-------------------
1 file changed, 32 insertions(+), 19 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index d848888..c512ae0 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -144,11 +144,13 @@ static const char *cgroup_subsys_name[] = {
};
#undef SUBSYS
-/* array of static_keys for cgroup_subsys_enabled() and cgroup_subsys_on_dfl() */
-#define SUBSYS(_x) \
- DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_enabled_key); \
- DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_on_dfl_key); \
- EXPORT_SYMBOL_GPL(_x ## _cgrp_subsys_enabled_key); \
+/*
+ * array of static_keys for cgroup_subsys_enabled() and cgroup_subsys_on_dfl()
+ */
+#define SUBSYS(_x) \
+ DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_enabled_key); \
+ DEFINE_STATIC_KEY_TRUE(_x ## _cgrp_subsys_on_dfl_key); \
+ EXPORT_SYMBOL_GPL(_x ## _cgrp_subsys_enabled_key); \
EXPORT_SYMBOL_GPL(_x ## _cgrp_subsys_on_dfl_key);
#include <linux/cgroup_subsys.h>
#undef SUBSYS
@@ -682,7 +684,8 @@ static void css_set_update_populated(struct css_set *cset, bool populated)
* @from_cset and @to_cset's reference counts.
*/
static void css_set_move_task(struct task_struct *task,
- struct css_set *from_cset, struct css_set *to_cset,
+ struct css_set *from_cset,
+ struct css_set *to_cset,
bool use_mg_tasks)
{
lockdep_assert_held(&css_set_lock);
@@ -723,8 +726,8 @@ static void css_set_move_task(struct task_struct *task,
if (!css_set_populated(to_cset))
css_set_update_populated(to_cset, true);
rcu_assign_pointer(task->cgroups, to_cset);
- list_add_tail(&task->cg_list, use_mg_tasks ? &to_cset->mg_tasks :
- &to_cset->tasks);
+ list_add_tail(&task->cg_list,
+ use_mg_tasks ? &to_cset->mg_tasks : &to_cset->tasks);
}
}
@@ -2402,7 +2405,8 @@ static int cgroup_taskset_migrate(struct cgroup_taskset *tset,
*/
spin_lock_bh(&css_set_lock);
list_for_each_entry(cset, &tset->src_csets, mg_node) {
- list_for_each_entry_safe(task, tmp_task, &cset->mg_tasks, cg_list) {
+ list_for_each_entry_safe(task, tmp_task,
+ &cset->mg_tasks, cg_list) {
struct css_set *from_cset = task_css_set(task);
struct css_set *to_cset = cset->mg_dst_cset;
@@ -2464,7 +2468,8 @@ static void cgroup_migrate_finish(struct list_head *preloaded_csets)
lockdep_assert_held(&cgroup_mutex);
spin_lock_bh(&css_set_lock);
- list_for_each_entry_safe(cset, tmp_cset, preloaded_csets, mg_preload_node) {
+ list_for_each_entry_safe(cset, tmp_cset, preloaded_csets,
+ mg_preload_node) {
cset->mg_src_cgrp = NULL;
cset->mg_dst_cset = NULL;
list_del_init(&cset->mg_preload_node);
@@ -2545,7 +2550,8 @@ static int cgroup_migrate_prepare_dst(struct cgroup *dst_cgrp,
return -EBUSY;
/* look up the dst cset for each src cset and link it to src */
- list_for_each_entry_safe(src_cset, tmp_cset, preloaded_csets, mg_preload_node) {
+ list_for_each_entry_safe(src_cset, tmp_cset, preloaded_csets,
+ mg_preload_node) {
struct css_set *dst_cset;
dst_cset = find_css_set(src_cset,
@@ -3007,7 +3013,8 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
/* unavailable or not enabled on the parent? */
if (!(cgrp_dfl_root.subsys_mask & (1 << ssid)) ||
(cgroup_parent(cgrp) &&
- !(cgroup_parent(cgrp)->subtree_control & (1 << ssid)))) {
+ !(cgroup_parent(cgrp)->subtree_control &
+ (1 << ssid)))) {
ret = -ENOENT;
goto out_unlock;
}
@@ -3677,9 +3684,11 @@ struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
* races against release and the race window is very small.
*/
if (!pos) {
- next = list_entry_rcu(parent->children.next, struct cgroup_subsys_state, sibling);
+ next = list_entry_rcu(parent->children.next,
+ struct cgroup_subsys_state, sibling);
} else if (likely(!(pos->flags & CSS_RELEASED))) {
- next = list_entry_rcu(pos->sibling.next, struct cgroup_subsys_state, sibling);
+ next = list_entry_rcu(pos->sibling.next,
+ struct cgroup_subsys_state, sibling);
} else {
list_for_each_entry_rcu(next, &parent->children, sibling)
if (next->serial_nr > pos->serial_nr)
@@ -4152,7 +4161,8 @@ static void cgroup_pidlist_destroy_all(struct cgroup *cgrp)
mutex_lock(&cgrp->pidlist_mutex);
list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links)
- mod_delayed_work(cgroup_pidlist_destroy_wq, &l->destroy_dwork, 0);
+ mod_delayed_work(cgroup_pidlist_destroy_wq,
+ &l->destroy_dwork, 0);
mutex_unlock(&cgrp->pidlist_mutex);
flush_workqueue(cgroup_pidlist_destroy_wq);
@@ -4968,7 +4978,8 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
cgrp->self.serial_nr = css_serial_nr_next++;
/* allocation complete, commit to creation */
- list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children);
+ list_add_tail_rcu(&cgrp->self.sibling,
+ &cgroup_parent(cgrp)->self.children);
atomic_inc(&root->nr_cgrps);
cgroup_get(parent);
@@ -5337,7 +5348,8 @@ int __init cgroup_init(void)
WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes));
} else {
WARN_ON(cgroup_add_dfl_cftypes(ss, ss->dfl_cftypes));
- WARN_ON(cgroup_add_legacy_cftypes(ss, ss->legacy_cftypes));
+ WARN_ON(cgroup_add_legacy_cftypes(ss,
+ ss->legacy_cftypes));
}
if (ss->bind)
@@ -5408,8 +5420,9 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
if (root != &cgrp_dfl_root)
for_each_subsys(ss, ssid)
if (root->subsys_mask & (1 << ssid))
- seq_printf(m, "%s%s", count++ ? "," : "",
- ss->legacy_name);
+ seq_printf(m, "%s%s",
+ count++ ? "," : "",
+ ss->legacy_name);
if (strlen(root->name))
seq_printf(m, "%sname=%s", count ? "," : "",
root->name);
--
2.6.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] cgroup: Fix trailing */ in block comments.
[not found] ` <1450182045-27480-1-git-send-email-kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-15 12:20 ` [PATCH 2/6] cgroup: Fix line length to 80 characters Jakub Kunert
@ 2015-12-15 12:20 ` Jakub Kunert
2015-12-15 12:20 ` [PATCH 4/6] cgroup: Add blank lines after declarations Jakub Kunert
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Jakub Kunert @ 2015-12-15 12:20 UTC (permalink / raw)
To: tj-DgEjT+Ai2ygdnm+yROfE0A; +Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, Jakub Kunert
Fix checkpatch.pl warning:
WARNING: Block comments use a trailing */ on a separate line
Signed-off-by: Jakub Kunert <kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
kernel/cgroup.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c512ae0..3e1e112 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1015,8 +1015,10 @@ static struct css_set *find_css_set(struct css_set *old_cset,
lockdep_assert_held(&cgroup_mutex);
- /* First see if we already have a cgroup group that matches
- * the desired set */
+ /*
+ * First see if we already have a cgroup group that matches
+ * the desired set
+ */
spin_lock_bh(&css_set_lock);
cset = find_existing_css_set(old_cset, cgrp, template);
if (cset)
@@ -1045,8 +1047,10 @@ static struct css_set *find_css_set(struct css_set *old_cset,
INIT_LIST_HEAD(&cset->task_iters);
INIT_HLIST_NODE(&cset->hlist);
- /* Copy the set of subsystem state objects generated in
- * find_existing_css_set() */
+ /*
+ * Copy the set of subsystem state objects generated in
+ * find_existing_css_set()
+ */
memcpy(cset->subsys, template, sizeof(cset->subsys));
spin_lock_bh(&css_set_lock);
@@ -5227,10 +5231,12 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)
BUG_ON(css->id < 0);
}
- /* Update the init_css_set to contain a subsys
+ /*
+ * Update the init_css_set to contain a subsys
* pointer to this state - since the subsystem is
* newly registered, all tasks and hence the
- * init_css_set is in the subsystem's root cgroup. */
+ * init_css_set is in the subsystem's root cgroup.
+ */
init_css_set.subsys[ss->id] = css;
have_fork_callback |= (bool)ss->fork << ss->id;
@@ -5238,9 +5244,11 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)
have_free_callback |= (bool)ss->free << ss->id;
have_canfork_callback |= (bool)ss->can_fork << ss->id;
- /* At system boot, before all subsystems have been
+ /*
+ * At system boot, before all subsystems have been
* registered, no tasks have been forked, so we don't
- * need to invoke fork callbacks here. */
+ * need to invoke fork callbacks here.
+ */
BUG_ON(!list_empty(&init_task.tasks));
BUG_ON(online_css(css));
--
2.6.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] cgroup: Add blank lines after declarations.
[not found] ` <1450182045-27480-1-git-send-email-kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-15 12:20 ` [PATCH 2/6] cgroup: Fix line length to 80 characters Jakub Kunert
2015-12-15 12:20 ` [PATCH 3/6] cgroup: Fix trailing */ in block comments Jakub Kunert
@ 2015-12-15 12:20 ` Jakub Kunert
2015-12-15 12:20 ` [PATCH 5/6] cgroup: Replace printk(KERN_INFO) with pr_info() Jakub Kunert
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Jakub Kunert @ 2015-12-15 12:20 UTC (permalink / raw)
To: tj-DgEjT+Ai2ygdnm+yROfE0A; +Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, Jakub Kunert
Fix checkpatch.pl warnings:
WARNING: Missing a blank line after declarations
Signed-off-by: Jakub Kunert <kuba.kunert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
kernel/cgroup.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3e1e112..9e248bc 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1688,6 +1688,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
/* Must match [\w.-]+ */
for (i = 0; i < strlen(name); i++) {
char c = name[i];
+
if (isalnum(c))
continue;
if ((c == '.') || (c == '-') || (c == '_'))
@@ -3228,11 +3229,13 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
if (cft->write_u64) {
unsigned long long v;
+
ret = kstrtoull(buf, 0, &v);
if (!ret)
ret = cft->write_u64(css, cft, v);
} else if (cft->write_s64) {
long long v;
+
ret = kstrtoll(buf, 0, &v);
if (!ret)
ret = cft->write_s64(css, cft, v);
@@ -4493,6 +4496,7 @@ static void *cgroup_pidlist_start(struct seq_file *s, loff_t *pos)
while (index < end) {
int mid = (index + end) / 2;
+
if (cgroup_pid_fry(cgrp, l->list[mid]) == pid) {
index = mid;
break;
@@ -5520,6 +5524,7 @@ static void **subsys_canfork_priv_p(void *ss_priv[CGROUP_CANFORK_COUNT], int i)
static void *subsys_canfork_priv(void *ss_priv[CGROUP_CANFORK_COUNT], int i)
{
void **private = subsys_canfork_priv_p(ss_priv, i);
+
return private ? *private : NULL;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 9+ messages in thread