cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] memcg: replace unsigned long by u64 to avoid overflow
@ 2012-06-23  6:15 Wanpeng Li
  2012-06-23  8:15 ` Johannes Weiner
  0 siblings, 1 reply; 6+ messages in thread
From: Wanpeng Li @ 2012-06-23  6:15 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg
  Cc: Michal Hocko, Johannes Weiner, Balbir Singh, KAMEZAWA Hiroyuki,
	Andrew Morton, Mel Gorman, Minchan Kim,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	cgroups-u79uwXL29TY76Z2rM5mHXA, Gavin Shan, Wanpeng Li

From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

Since the return value variable in mem_cgroup_zone_nr_lru_pages and
mem_cgroup_node_nr_lru_pages functions are u64, so replace the return
value of funtions by u64 to avoid overflow.

Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 mm/memcontrol.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a2677e0..724bd02 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -776,8 +776,7 @@ mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
 	return ret;
 }
 
-static unsigned long
-mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
+static u64 mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
 			int nid, unsigned int lru_mask)
 {
 	u64 total = 0;
@@ -790,7 +789,7 @@ mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
 	return total;
 }
 
-static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,
+static u64 mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,
 			unsigned int lru_mask)
 {
 	int nid;
-- 
1.7.9.5

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

end of thread, other threads:[~2012-06-25  4:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-23  6:15 [PATCH 1/6] memcg: replace unsigned long by u64 to avoid overflow Wanpeng Li
2012-06-23  8:15 ` Johannes Weiner
2012-06-23  9:03   ` Wanpeng Li
2012-06-23  9:26     ` Johannes Weiner
2012-06-25  4:24       ` Kamezawa Hiroyuki
     [not found]         ` <4FE7E7FA.80702-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-06-25  4:46           ` Wanpeng Li

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).