All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	shiwh@cn.fujitsu.com,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"xemul@openvz.org" <xemul@openvz.org>
Subject: Re: [PATCH] fix page_reset_bad_cgroup
Date: Thu, 17 Apr 2008 20:22:21 -0700	[thread overview]
Message-ID: <20080417202221.063aa171.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080418121046.892c44a5.kamezawa.hiroyu@jp.fujitsu.com>

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?



  reply	other threads:[~2008-04-18  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18  3:10 [PATCH] fix page_reset_bad_cgroup KAMEZAWA Hiroyuki
2008-04-18  3:22 ` Andrew Morton [this message]
2008-04-18  3:36   ` KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080417202221.063aa171.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shiwh@cn.fujitsu.com \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.