indent an if statement
Subsystems (2)
PATCH 1/1 indent an if statement
The "n += 32;" goes with the if statement on the line before so it should be indented.
fs/xfs/xfs_bit.h +1 -1
@@ -67,7 +67,7 @@ static inline int xfs_lowbit64(__uint64_t v) }else {/* upper bits */ w = (__uint32_t)(v >>32 );if (w && (n =ffs (w))) - n +=32 ; + n +=32 ; }return n -1 ; }
Quoted 4 lines · Dan Carpenter
The "n += 32;" goes with the if statement on the line before so it should be indented.
Signed-off-by Dan Carpenter <[email protected]>
Easy one ;)
Wow, it's been this way ever since 79071eb0 in 2008.
Quoted 19 lines
fs/xfs/xfs_bit.h +1
-1@@ -67,7 +67,7 @@ static inline int xfs_lowbit64(__uint64_t v) }else {/* upper bits */ w = (__uint32_t)(v >>32 );if (w && (n =ffs (w))) - n +=32 ; + n +=32 ; }return n -1 ; }_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Dan Carpenter
The "n += 32;" goes with the if statement on the line before so it should be indented.
Signed-off-by Dan Carpenter <[email protected]>fs/xfs/xfs_bit.h +0
-0
fs/xfs/xfs_bit.h static inline int xfs_lowbit64(__uint64_t v) · line 70
Quoted 5 lines
fs/xfs/xfs_bit.h +1
-1@@ -67,7 +67,7 @@ static inline int xfs_lowbit64(__uint64_t v) }else {/* upper bits */ w = (__uint32_t)(v >>32 );if (w && (n =ffs (w))) - n +=32 ; + n +=32 ;
If we want to clean up this stuff let's do it properly:
if (w) {
n = ffs(w);
if (n)
n += 32;
}Quoted 19 lines · Christoph Hellwig
Quoted 10 lines · Dan Carpenter
The "n += 32;" goes with the if statement on the line before so it should be indented.
Signed-off-by Dan Carpenter <[email protected]>fs/xfs/xfs_bit.h +0
-0fs/xfs/xfs_bit.h static inline int xfs_lowbit64(__uint64_t v) · line 70
Quoted 5 lines
fs/xfs/xfs_bit.h +1
-1@@ -67,7 +67,7 @@ static inline int xfs_lowbit64(__uint64_t v) }else {/* upper bits */ w = (__uint32_t)(v >>32 );if (w && (n =ffs (w))) - n +=32 ; + n +=32 ;If we want to clean up this stuff let's do it properly:
Quoted 6 lines
if (w) {
n = ffs(w);
if (n)
n += 32;
}Sure. I will resend.
regards,
dan carpenter
Am 21.05.2014 16:35, schrieb Dan Carpenter:
Quoted 20 lines · Christoph Hellwig
Quoted 19 lines · Dan Carpenter
Quoted 10 lines
The "n += 32;" goes with the if statement on the line before so it should be indented.
Signed-off-by Dan Carpenter <[email protected]>fs/xfs/xfs_bit.h +0
-0fs/xfs/xfs_bit.h static inline int xfs_lowbit64(__uint64_t v) · line 70
Quoted 5 lines
fs/xfs/xfs_bit.h +1
-1@@ -67,7 +67,7 @@ static inline int xfs_lowbit64(__uint64_t v) }else {/* upper bits */ w = (__uint32_t)(v >>32 );if (w && (n =ffs (w))) - n +=32 ; + n +=32 ;If we want to clean up this stuff let's do it properly:
Quoted 7 lines
Quoted 6 lines
if (w) { n = ffs(w); if (n) n += 32; }
This looks like a ffsll() maybe there are other implemantions and we can make a generic version (acualy i found only a ffsll() in nouvou, NTL).
just my 2 cents,
re,
wh
Quoted 11 lines
Sure. I will resend.
regards,
dan carpenter--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · walter harms
This looks like a
ffsll()maybe there are other implemantions and we can make a generic version (acualy i found only affsll()in nouvou, NTL).
All the helper in xfs_bit.[ch] are probably candidates for generic library functions.
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · walter harms
This looks like a
ffsll()maybe there are other implemantions and we can make a generic version (acualy i found only affsll()in nouvou, NTL).All the helper in xfs_bit.[ch] are probably candidates for generic library functions.
Discussed in the thread:
http://oss.sgi.com/archives/xfs/2014-01/msg00542.html
--Mark.
PATCH v2 1/1 small cleanup in xfs_lowbit64()
In reply to Christoph HellwigThere are two checkpatch.pl complaints here because of the bad indenting and because of the assignment inside the condition.
---
v2: more cleanups
fs/xfs/xfs_bit.h +5 -2
@@ -66,8 +66,11 @@ static inline int xfs_lowbit64(__uint64_t v) n =ffs (w); }else {/* upper bits */ w = (__uint32_t)(v >>32 ); -if (w && (n =ffs (w))) - n +=32 ; +if (w) { + n =ffs (w); +if (n) + n +=32 ; + } }return n -1 ; }