Re: [PATCH] - TPM device driver layer (tpm.c|h) - 2nd repost

From: Andrew Morton
Date: Tue Nov 20 2007 - 15:07:29 EST


On Tue, 20 Nov 2007 13:32:06 +0100
Richard MUSIL <richard.musil@xxxxxx> wrote:

> >> + if (chip->vendor.release)
> >> + chip->vendor.release(dev);
> >> +
> >> + /* it *should* be: chip->release != NULL */
> >
> > And that one's actually wrong in the context of kernel coding practices.
> > But whatever.
>
> Well I am not sure, what is exactly against coding practices (this is
> my first patch, so bear with me). Was it the comment? Or the "likely".

The code was

/* it *should* be: chip->release != NULL */
if (chip->release)

and the I took the comment to mean that it should be

if (chip->release != NULL)

I was just pointing out that the test-pointer-as-truth-value trick is
smiled upon in kernel coding.

> But, anyway, I guess I was a bit paranoic. chip->release is set to
> original device::release and this should be set to platform_device_release
> at least (and if someone messed with it, it should not be NULL anyway).
> So I removed complete condition.

>From the above it appears that the code comment misled me.
-
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/