Skip to contentSkip to conversation

cgroup: move assignement out of condition in cgroup_attach_proc()

PATCH Applied Dan Carpenter 2 participants 3 messages Jan 4, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: move assignement out of condition in cgroup_attach_proc()

Gcc complains about this: "kernel/cgroup.c:2179:4: warning: suggest parentheses around assignment used as truth value [-Wparentheses]"

---
I feel like the original developer may have left the parens out on deliberately to stop checkpatch.pl complaining about long lines. I so much hate the long line warning...

kernel/cgroup.c +5 -2
index cb3c131..6a057fe 100644
@@ -2175,9 +2175,12 @@ static int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
 		oldcg = tc->task->cgroups;
 
 		/* if we don't already have it in the list get a new one */
-		if (!css_set_check_fetched(cgrp, tc->task, oldcg, &newcg_list))
-			if (retval = css_set_prefetch(cgrp, oldcg, &newcg_list))
+		if (!css_set_check_fetched(cgrp, tc->task, oldcg,
+					&newcg_list)) {
+			retval = css_set_prefetch(cgrp, oldcg, &newcg_list);
+			if (retval)
 				goto out_list_teardown;
+		}
 	}
 
 	/*

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#2 lore raw
Quoted 4 lines · Dan Carpenter

Gcc complains about this: "kernel/cgroup.c:2179:4: warning: suggest parentheses around assignment used as truth value [-Wparentheses]"

Applied to cgroup/for-3.3. Li, applied w/o your ack as it's trivial.

Thanks.

Signature · 1 line
tejun