Re: [PATCH 109/148] include/asm-x86/serial.h: checkpatch cleanups - formatting only

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörn
Date: Tuesday, March 25, 2008 - 9:07 am

On Tue, 25 March 2008 14:45:56 +0100, Ingo Molnar wrote:

The last should and will be fixed.  The // I don't really care about.
Send a patch if you do.

Going over my logfs patch, I found several things that are either false
positives or rather questionable in my book.  <adds Andy to Cc:>


(foo*) should be (foo *)
	What does that extra space gain us?


ERROR: no space before that close parenthesis ')'
#2565: FILE: fs/logfs/gc.c:294:
+                       seg_ofs + sizeof(oh) < super->s_segsize; ) {

Actual code is this:
	for (seg_ofs = LOGFS_SEGMENT_HEADERSIZE;
			seg_ofs + sizeof(oh) < super->s_segsize; ) {
The for() loop is missing one of its three terms.  I assume this is one
of the effects of not having a perfect C parser.


ERROR: trailing statements should be on next line
#5000: FILE: fs/logfs/readwrite.c:203:
+       } else while (unlikely(TestSetPageLocked(page))) {

We have an explicit exception for "else if".  "else while" makes imo
just as much (or as little) sense.


ERROR: need space after that ',' (ctx:VxV)
#5801: FILE: fs/logfs/readwrite.c:1004:
+               ret = logfs_segment_read(inode, ipage, this_wc->ofs, bix,level);
                                      
One of those examples where a missing space is the lesser of two or
three evils.


ERROR: need consistent spacing around '|' (ctx:WxV)
#8293: FILE: fs/logfs/dev_mtd.c:376:
+                       |SLAB_MEM_SPREAD|SLAB_PANIC),

I have no idea what this is about.  Original code:
	mtd_cache = kmem_cache_create("mtd_cache", sizeof(struct mtd_inode), 0,
			(SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT
			 |SLAB_MEM_SPREAD|SLAB_PANIC),

Jörn

-- 
Victory in war is not repetitious.
-- Sun Tzu
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 109/148] include/asm-x86/serial.h: checkpatch c ..., Jörn, (Tue Mar 25, 9:07 am)
Re: [PATCH 109/148] include/asm-x86/serial.h: checkpatch c ..., Paolo Ciarrocchi, (Tue Mar 25, 11:23 am)
[patch] bkl2mtd: cleanup, Ingo Molnar, (Wed Mar 26, 3:14 am)
Re: [patch] bkl2mtd: cleanup, Al Viro, (Wed Mar 26, 3:48 am)
Re: [patch] bkl2mtd: cleanup, Jörn, (Wed Mar 26, 3:57 am)
Re: [patch] bkl2mtd: cleanup, Ingo Molnar, (Wed Mar 26, 4:00 am)
Re: [patch] bkl2mtd: cleanup, Ingo Molnar, (Wed Mar 26, 4:02 am)
Re: [PATCH 109/148] include/asm-x86/serial.h: checkpatch c ..., Christoph Hellwig, (Wed Mar 26, 4:09 am)
Re: [patch] bkl2mtd: cleanup, Ingo Molnar, (Wed Mar 26, 4:10 am)
Re: [patch] bkl2mtd: cleanup, Jiri Slaby, (Wed Mar 26, 4:14 am)
Re: [patch] bkl2mtd: cleanup, Joe Perches, (Wed Mar 26, 9:30 am)