提交 b7c46d15 编写于 作者: J Johannes Weiner 提交者: Linus Torvalds

mm: drop unneeded double negations

Remove double negations where the operand is already boolean.
Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 bba78819
...@@ -648,7 +648,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, ...@@ -648,7 +648,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
int nid = z->zone_pgdat->node_id; int nid = z->zone_pgdat->node_id;
int zid = zone_idx(z); int zid = zone_idx(z);
struct mem_cgroup_per_zone *mz; struct mem_cgroup_per_zone *mz;
int lru = LRU_FILE * !!file + !!active; int lru = LRU_FILE * file + active;
int ret; int ret;
BUG_ON(!mem_cont); BUG_ON(!mem_cont);
......
...@@ -599,7 +599,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, ...@@ -599,7 +599,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
if (page) { if (page) {
get_page(page); get_page(page);
page_dup_rmap(page); page_dup_rmap(page);
rss[!!PageAnon(page)]++; rss[PageAnon(page)]++;
} }
out_set_pte: out_set_pte:
......
...@@ -971,7 +971,7 @@ static unsigned long isolate_pages_global(unsigned long nr, ...@@ -971,7 +971,7 @@ static unsigned long isolate_pages_global(unsigned long nr,
if (file) if (file)
lru += LRU_FILE; lru += LRU_FILE;
return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, order, return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, order,
mode, !!file); mode, file);
} }
/* /*
...@@ -1209,7 +1209,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, ...@@ -1209,7 +1209,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
lru = page_lru(page); lru = page_lru(page);
add_page_to_lru_list(zone, page, lru); add_page_to_lru_list(zone, page, lru);
if (is_active_lru(lru)) { if (is_active_lru(lru)) {
int file = !!is_file_lru(lru); int file = is_file_lru(lru);
reclaim_stat->recent_rotated[file]++; reclaim_stat->recent_rotated[file]++;
} }
if (!pagevec_add(&pvec, page)) { if (!pagevec_add(&pvec, page)) {
...@@ -1319,7 +1319,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, ...@@ -1319,7 +1319,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
if (scanning_global_lru(sc)) { if (scanning_global_lru(sc)) {
zone->pages_scanned += pgscanned; zone->pages_scanned += pgscanned;
} }
reclaim_stat->recent_scanned[!!file] += nr_taken; reclaim_stat->recent_scanned[file] += nr_taken;
__count_zone_vm_events(PGREFILL, zone, pgscanned); __count_zone_vm_events(PGREFILL, zone, pgscanned);
if (file) if (file)
...@@ -1372,7 +1372,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, ...@@ -1372,7 +1372,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
* helps balance scan pressure between file and anonymous pages in * helps balance scan pressure between file and anonymous pages in
* get_scan_ratio. * get_scan_ratio.
*/ */
reclaim_stat->recent_rotated[!!file] += nr_rotated; reclaim_stat->recent_rotated[file] += nr_rotated;
move_active_pages_to_lru(zone, &l_active, move_active_pages_to_lru(zone, &l_active,
LRU_ACTIVE + file * LRU_FILE); LRU_ACTIVE + file * LRU_FILE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册