linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] cgroup brace coding style fix
@ 2007-10-24 17:36 Paul Jackson
  2007-10-26  1:15 ` Paul Menage
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Jackson @ 2007-10-24 17:36 UTC (permalink / raw)
  To: Paul Menage; +Cc: Paul Jackson, Adrian Bunk, linux-kernel

From: Paul Jackson <pj@sgi.com>

Coding style fix - one line conditionals don't get braces.

Signed-off-by: Paul Jackson <pj@sgi.com>

---

This patch applies --after-- Adrian Bunk's patch:
    [2.6 patch] kernel/cgroup.c: remove dead code

 kernel/cgroup.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

--- 2.6.23-mm1.orig/kernel/cgroup.c	2007-10-24 09:51:20.289137770 -0700
+++ 2.6.23-mm1/kernel/cgroup.c	2007-10-24 09:51:52.153617193 -0700
@@ -1182,9 +1182,8 @@ static int attach_task(struct cgroup *cg
 	for_each_subsys(root, ss) {
 		if (ss->can_attach) {
 			retval = ss->can_attach(ss, cgrp, tsk);
-			if (retval) {
+			if (retval)
 				return retval;
-			}
 		}
 	}
 
@@ -1193,9 +1192,8 @@ static int attach_task(struct cgroup *cg
 	 * based on its final set of cgroups
 	 */
 	newcg = find_css_set(cg, cgrp);
-	if (!newcg) {
+	if (!newcg)
 		return -ENOMEM;
-	}
 
 	task_lock(tsk);
 	if (tsk->flags & PF_EXITING) {
@@ -1215,9 +1213,8 @@ static int attach_task(struct cgroup *cg
 	write_unlock(&css_set_lock);
 
 	for_each_subsys(root, ss) {
-		if (ss->attach) {
+		if (ss->attach)
 			ss->attach(ss, cgrp, oldcgrp, tsk);
-		}
 	}
 	set_bit(CGRP_RELEASABLE, &oldcgrp->flags);
 	synchronize_rcu();
@@ -1353,9 +1350,8 @@ static ssize_t cgroup_common_file_write(
 	{
 		struct cgroupfs_root *root = cgrp->root;
 		/* Strip trailing newline */
-		if (nbytes && (buffer[nbytes-1] == '\n')) {
+		if (nbytes && (buffer[nbytes-1] == '\n'))
 			buffer[nbytes-1] = 0;
-		}
 		/* We never write anything other than '\0'
 		 * into the last char of release_agent_path,
 		 * so it always remains a NUL-terminated
@@ -2123,9 +2119,8 @@ static inline int cgroup_has_css_refs(st
 		 * matter, since it can only happen if the cgroup
 		 * has been deleted and hence no longer needs the
 		 * release agent to be called anyway. */
-		if (css && atomic_read(&css->refcnt)) {
+		if (css && atomic_read(&css->refcnt))
 			return 1;
-		}
 	}
 	return 0;
 }

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] cgroup brace coding style fix
  2007-10-24 17:36 [RFC] cgroup brace coding style fix Paul Jackson
@ 2007-10-26  1:15 ` Paul Menage
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Menage @ 2007-10-26  1:15 UTC (permalink / raw)
  To: Paul Jackson; +Cc: Adrian Bunk, linux-kernel, Andrew Morton

On 10/24/07, Paul Jackson <pj@sgi.com> wrote:
> From: Paul Jackson <pj@sgi.com>
>
> Coding style fix - one line conditionals don't get braces.
>
> Signed-off-by: Paul Jackson <pj@sgi.com>

Not a coding style that I'm in favor of, but I suppose it is the
kernel standard.

Acked-by: Paul Menage <menage@google.com>

>
> ---
>
> This patch applies --after-- Adrian Bunk's patch:
>     [2.6 patch] kernel/cgroup.c: remove dead code
>
>  kernel/cgroup.c |   15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> --- 2.6.23-mm1.orig/kernel/cgroup.c     2007-10-24 09:51:20.289137770 -0700
> +++ 2.6.23-mm1/kernel/cgroup.c  2007-10-24 09:51:52.153617193 -0700
> @@ -1182,9 +1182,8 @@ static int attach_task(struct cgroup *cg
>         for_each_subsys(root, ss) {
>                 if (ss->can_attach) {
>                         retval = ss->can_attach(ss, cgrp, tsk);
> -                       if (retval) {
> +                       if (retval)
>                                 return retval;
> -                       }
>                 }
>         }
>
> @@ -1193,9 +1192,8 @@ static int attach_task(struct cgroup *cg
>          * based on its final set of cgroups
>          */
>         newcg = find_css_set(cg, cgrp);
> -       if (!newcg) {
> +       if (!newcg)
>                 return -ENOMEM;
> -       }
>
>         task_lock(tsk);
>         if (tsk->flags & PF_EXITING) {
> @@ -1215,9 +1213,8 @@ static int attach_task(struct cgroup *cg
>         write_unlock(&css_set_lock);
>
>         for_each_subsys(root, ss) {
> -               if (ss->attach) {
> +               if (ss->attach)
>                         ss->attach(ss, cgrp, oldcgrp, tsk);
> -               }
>         }
>         set_bit(CGRP_RELEASABLE, &oldcgrp->flags);
>         synchronize_rcu();
> @@ -1353,9 +1350,8 @@ static ssize_t cgroup_common_file_write(
>         {
>                 struct cgroupfs_root *root = cgrp->root;
>                 /* Strip trailing newline */
> -               if (nbytes && (buffer[nbytes-1] == '\n')) {
> +               if (nbytes && (buffer[nbytes-1] == '\n'))
>                         buffer[nbytes-1] = 0;
> -               }
>                 /* We never write anything other than '\0'
>                  * into the last char of release_agent_path,
>                  * so it always remains a NUL-terminated
> @@ -2123,9 +2119,8 @@ static inline int cgroup_has_css_refs(st
>                  * matter, since it can only happen if the cgroup
>                  * has been deleted and hence no longer needs the
>                  * release agent to be called anyway. */
> -               if (css && atomic_read(&css->refcnt)) {
> +               if (css && atomic_read(&css->refcnt))
>                         return 1;
> -               }
>         }
>         return 0;
>  }
>
> --
>                           I won't rest till it's the best ...
>                           Programmer, Linux Scalability
>                           Paul Jackson <pj@sgi.com> 1.650.933.1373
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-26  1:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-24 17:36 [RFC] cgroup brace coding style fix Paul Jackson
2007-10-26  1:15 ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).