Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)

From: Pekka J Enberg
Date: Thu Apr 27 2006 - 02:28:49 EST


On Wed, 26 Apr 2006, Kyle Moffett wrote:
> Here's code that I've found works as well as can be expected under both GCC 3
> and GCC 4. If xp is a known-NULL constant the whole function will be
> optimized out completely. If xp is known-not-NULL, then it will optimize to a
> kfree function without the null check. Otherwise it optimizes to call the
> out-of-line version.

Wouldn't it be better to simply remove calls to kfree() with known
NULL constant?

Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/