aboutsummaryrefslogtreecommitdiff
path: root/fs/kernfs/dir.c
diff options
context:
space:
mode:
authorFelipe Balbi2015-01-19 09:57:20 -0600
committerFelipe Balbi2015-01-19 09:57:20 -0600
commitd1fc4440d761af47fd0c32661725011bf66ebb51 (patch)
treed2fdfe049eac9b45a9418bd1be103297b1c0c55e /fs/kernfs/dir.c
parentfe198e34a44ce7f27e39c303d62a754129938194 (diff)
parentec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff)
Merge tag 'v3.19-rc5' into next
Linux 3.19-rc5 Conflicts: drivers/usb/dwc2/gadget.c drivers/usb/gadget/udc/bdc/bdc_ep.c
Diffstat (limited to 'fs/kernfs/dir.c')
-rw-r--r--fs/kernfs/dir.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 37989f02a226..2d881b381d2b 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -201,10 +201,14 @@ static unsigned int kernfs_name_hash(const char *name, const void *ns)
static int kernfs_name_compare(unsigned int hash, const char *name,
const void *ns, const struct kernfs_node *kn)
{
- if (hash != kn->hash)
- return hash - kn->hash;
- if (ns != kn->ns)
- return ns - kn->ns;
+ if (hash < kn->hash)
+ return -1;
+ if (hash > kn->hash)
+ return 1;
+ if (ns < kn->ns)
+ return -1;
+ if (ns > kn->ns)
+ return 1;
return strcmp(name, kn->name);
}