Re: [PATCH] include/linux/slab.h: new KFREE() macro.

Al Viro
2007-01-08T09:09:32Z

On Mon, Jan 08, 2007 at 12:47:07AM -0800, Amit Choudhary wrote:

> Let's try to apply the same logic to my explanation:
>
> KFREE() macro has __actually__ been used at atleast 1000 places in the kernel by atleast 50
> different people. Doesn't that lend enough credibility to what I am saying.

No. Simple "it happens a lot of times" is _not_ enough to establish
credibility of "it should be done that way". It is a good reason to
research the rationale in each case.

> People did something like this 1000 times: kfree(x), x = NULL. I simply proposed the KFREE() macro
> that does the same thing. Resistance to something that is already being done in the kernel. I
> really do not care whether it goes in the kernel or not. There are lots of other places where I
> can contribute. But I do not understand the resistance.
>
> It is already being done in the kernel.

And each instance either has a reason for doing it that way or is useless
or is a bug. Reasons, where they actually exist, very likely are not
uniform.

Blind copying of patterns without understanding what and why they are
doing is a Very Bad Thing(tm). That's how the bugs are created and
propagated, BTW.