* Re: [PATCH] mm: Fix some coding styles on mm/ tree
2010-03-04 11:09 [PATCH] mm: Fix some coding styles on mm/ tree wzt.wzt
@ 2010-03-04 4:06 ` KOSAKI Motohiro
2010-03-04 23:29 ` Andrew Morton
1 sibling, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2010-03-04 4:06 UTC (permalink / raw)
To: wzt.wzt; +Cc: kosaki.motohiro, linux-kernel, linux-mm, akpm
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index c26986c..fbe2793 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1327,9 +1327,9 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
> * zone->pages_scanned is used for detect zone's oom
> * mem_cgroup remembers nr_scan by itself.
> */
> - if (scanning_global_lru(sc)) {
> + if (scanning_global_lru(sc))
> zone->pages_scanned += pgscanned;
> - }
> +
> reclaim_stat->recent_scanned[file] += nr_taken;
>
> __count_zone_vm_events(PGREFILL, zone, pgscanned);
Probably this part is my fault.
Thanks! Zhitong.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mm: Fix some coding styles on mm/ tree
@ 2010-03-04 11:09 wzt.wzt
2010-03-04 4:06 ` KOSAKI Motohiro
2010-03-04 23:29 ` Andrew Morton
0 siblings, 2 replies; 3+ messages in thread
From: wzt.wzt @ 2010-03-04 11:09 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, akpm
Fix some coding styles on mm/ tree.
Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
---
mm/filemap.c | 10 ++++------
mm/filemap_xip.c | 3 +--
mm/slab.c | 8 ++++----
mm/vmscan.c | 4 ++--
4 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 698ea80..4c48e87 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2001,9 +2001,8 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
send_sig(SIGXFSZ, current, 0);
return -EFBIG;
}
- if (*count > limit - (typeof(limit))*pos) {
+ if (*count > limit - (typeof(limit))*pos)
*count = limit - (typeof(limit))*pos;
- }
}
}
@@ -2012,12 +2011,11 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
*/
if (unlikely(*pos + *count > MAX_NON_LFS &&
!(file->f_flags & O_LARGEFILE))) {
- if (*pos >= MAX_NON_LFS) {
+ if (*pos >= MAX_NON_LFS)
return -EFBIG;
- }
- if (*count > MAX_NON_LFS - (unsigned long)*pos) {
+
+ if (*count > MAX_NON_LFS - (unsigned long)*pos)
*count = MAX_NON_LFS - (unsigned long)*pos;
- }
}
/*
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index 1888b2d..56acab8 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -84,9 +84,8 @@ do_xip_mapping_read(struct address_space *mapping,
if (index > end_index)
goto out;
nr = ((isize - 1) & ~PAGE_CACHE_MASK) + 1;
- if (nr <= offset) {
+ if (nr <= offset)
goto out;
- }
}
nr = nr - offset;
if (nr > len - copied)
diff --git a/mm/slab.c b/mm/slab.c
index 7451bda..18418e1 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2216,13 +2216,13 @@ kmem_cache_create (const char *name, size_t size, size_t align,
}
/* 2) arch mandated alignment */
- if (ralign < ARCH_SLAB_MINALIGN) {
+ if (ralign < ARCH_SLAB_MINALIGN)
ralign = ARCH_SLAB_MINALIGN;
- }
+
/* 3) caller mandated alignment */
- if (ralign < align) {
+ if (ralign < align)
ralign = align;
- }
+
/* disable debug if necessary */
if (ralign > __alignof__(unsigned long long))
flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c26986c..fbe2793 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1327,9 +1327,9 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
* zone->pages_scanned is used for detect zone's oom
* mem_cgroup remembers nr_scan by itself.
*/
- if (scanning_global_lru(sc)) {
+ if (scanning_global_lru(sc))
zone->pages_scanned += pgscanned;
- }
+
reclaim_stat->recent_scanned[file] += nr_taken;
__count_zone_vm_events(PGREFILL, zone, pgscanned);
--
1.6.5.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: Fix some coding styles on mm/ tree
2010-03-04 11:09 [PATCH] mm: Fix some coding styles on mm/ tree wzt.wzt
2010-03-04 4:06 ` KOSAKI Motohiro
@ 2010-03-04 23:29 ` Andrew Morton
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2010-03-04 23:29 UTC (permalink / raw)
To: wzt.wzt; +Cc: linux-kernel, linux-mm
On Thu, 4 Mar 2010 19:09:16 +0800
wzt.wzt@gmail.com wrote:
> Fix some coding styles on mm/ tree.
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
>
> ---
> mm/filemap.c | 10 ++++------
> mm/filemap_xip.c | 3 +--
> mm/slab.c | 8 ++++----
> mm/vmscan.c | 4 ++--
> 4 files changed, 11 insertions(+), 14 deletions(-)
I don't mind fixing coding-style issues in there, but I would prefer
that it be more comprehensive than this - someone sits down and does a
series of large, more complete subystem-wide cleanups then sure, in the
long term it's worth the pain of merging them.
But I don't think it's good to do this as a slow, random ad-hoc
pitter-patter of changes like this one.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-04 23:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-04 11:09 [PATCH] mm: Fix some coding styles on mm/ tree wzt.wzt
2010-03-04 4:06 ` KOSAKI Motohiro
2010-03-04 23:29 ` Andrew Morton
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).