]> git.karo-electronics.de Git - linux-beck.git/commitdiff
vfs: clarify and clean up dentry_cmp()
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Mar 2012 22:47:15 +0000 (14:47 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Mar 2012 22:47:15 +0000 (14:47 -0800)
It did some odd things for unclear reasons.  As this is one of the
functions that gets changed when doing word-at-a-time compares, this is
yet another of the "don't change any semantics, but clean things up so
that subsequent patches don't get obscured by the cleanups".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/dcache.h

index f1c7eb8461be2054d3610a4a9e74375d8ba5a4d0..4270bedd230849c48a1e5387eb2d8a6b6e530a80 100644 (file)
@@ -54,18 +54,17 @@ extern struct dentry_stat_t dentry_stat;
 static inline int dentry_cmp(const unsigned char *cs, size_t scount,
                                const unsigned char *ct, size_t tcount)
 {
-       int ret;
        if (scount != tcount)
                return 1;
+
        do {
-               ret = (*cs != *ct);
-               if (ret)
-                       break;
+               if (*cs != *ct)
+                       return 1;
                cs++;
                ct++;
                tcount--;
        } while (tcount);
-       return ret;
+       return 0;
 }
 
 /* Name hashing routines. Initial hash value */