Re: [PATCH] kfree calls cleanup

From: Timothy Miller
Date: Wed Jun 02 2004 - 12:57:54 EST




BenoÃt Dejean wrote:
i've removed some useless test for NULL pointer before kfree calls.
if(p) kfree(p) -> kfree(p)
i've also removed variables that have become unused.
the patch is quite big, but i've check it many times.


This is valid since kfree checks for null pointer, but while the extra "if (p)" is redundant, if p is most often NULL somewhere, then you can avoid the function call overhead by this very low-cost check. (Unless kfree is a macro which includes the check in the macro.)

-
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/