lkml.org 
[lkml]   [2008]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix page_reset_bad_cgroup
On Fri, 18 Apr 2008 12:10:46 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> page->page_cgroup is unsigned long. Should be cleared by 0UL.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
>
> Index: linux-2.6.25/include/linux/memcontrol.h
> ===================================================================
> --- linux-2.6.25.orig/include/linux/memcontrol.h
> +++ linux-2.6.25/include/linux/memcontrol.h
> @@ -30,7 +30,7 @@ struct mm_struct;
> extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
> extern void mm_free_cgroup(struct mm_struct *mm);
>
> -#define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0)
> +#define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0UL)

That's pretty cosmetic.

In fact it could be argued that we shouldn't do this. "0" is zero
regardless of the type of the LHS. So if we later change page_cgroup to
u32 or u16 or `struct superblock *', the old page_reset_bad_cgroup() will
happily continue to work. There's no need to make this code aware of
page_cgroup's type, to this extent?




\
 
 \ /
  Last update: 2008-04-18 05:31    [W:0.046 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site