vfs: clarify and clean up dentry_cmp()
Changes
1 files changed · +4 −5
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| include/linux/dcache.h | modified | +4 | −5 | View file |
include/linux/dcache.h
View filediff --git a/include/linux/dcache.h b/include/linux/dcache.h
index f1c7eb8..4270bed 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -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 */