[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141204165320.GA2995@htj.dyndns.org>
Date: Thu, 4 Dec 2014 11:53:20 -0500
From: Tejun Heo <tj@...nel.org>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists