Messages in this thread | | | Date | Thu, 4 Dec 2014 11:53:20 -0500 | From | Tejun Heo <> | Subject | Re: [PATCH] kernfs: Fix kernfs_name_compare |
| |
Hello,
On Thu, Dec 04, 2014 at 05:19:34PM +0100, Rasmus Villemoes wrote: ... > { > + /* > + * This is ok because the hash values are restricted to [0, > + * 2^31-1] and because we are returning int (it would be wrong > + * had the return type been wider!). > + */ > if (hash != kn->hash) > return hash - kn->hash;
Let's just do < > comparisons here too and just note that trying to determine ordering through subtraction is dangerous.
Thanks.
-- tejun
| |