diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-06-17 19:27:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:03:47 -0400 |
commit | 338c843108bf5030d6765f4405126e70f8b77845 (patch) | |
tree | c3bdab2f288e4c5a843ea07e0f8938a821ab848a /mm/page_cgroup.c | |
parent | 302362c5abdda80b5c2e4e57be610c2e3c2ab3c5 (diff) |
memcg: remove some redundant checks
We don't need to check do_swap_account in the case that the function which
checks do_swap_account will never get called if do_swap_account == 0.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_cgroup.c')
-rw-r--r-- | mm/page_cgroup.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 672089d5819f..f22b4ebbd8dc 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c | |||
@@ -311,8 +311,6 @@ static int swap_cgroup_prepare(int type) | |||
311 | struct swap_cgroup_ctrl *ctrl; | 311 | struct swap_cgroup_ctrl *ctrl; |
312 | unsigned long idx, max; | 312 | unsigned long idx, max; |
313 | 313 | ||
314 | if (!do_swap_account) | ||
315 | return 0; | ||
316 | ctrl = &swap_cgroup_ctrl[type]; | 314 | ctrl = &swap_cgroup_ctrl[type]; |
317 | 315 | ||
318 | for (idx = 0; idx < ctrl->length; idx++) { | 316 | for (idx = 0; idx < ctrl->length; idx++) { |
@@ -349,9 +347,6 @@ unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) | |||
349 | struct swap_cgroup *sc; | 347 | struct swap_cgroup *sc; |
350 | unsigned short old; | 348 | unsigned short old; |
351 | 349 | ||
352 | if (!do_swap_account) | ||
353 | return 0; | ||
354 | |||
355 | ctrl = &swap_cgroup_ctrl[type]; | 350 | ctrl = &swap_cgroup_ctrl[type]; |
356 | 351 | ||
357 | mappage = ctrl->map[idx]; | 352 | mappage = ctrl->map[idx]; |
@@ -380,9 +375,6 @@ unsigned short lookup_swap_cgroup(swp_entry_t ent) | |||
380 | struct swap_cgroup *sc; | 375 | struct swap_cgroup *sc; |
381 | unsigned short ret; | 376 | unsigned short ret; |
382 | 377 | ||
383 | if (!do_swap_account) | ||
384 | return 0; | ||
385 | |||
386 | ctrl = &swap_cgroup_ctrl[type]; | 378 | ctrl = &swap_cgroup_ctrl[type]; |
387 | mappage = ctrl->map[idx]; | 379 | mappage = ctrl->map[idx]; |
388 | sc = page_address(mappage); | 380 | sc = page_address(mappage); |