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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 20 Nov 2007 13:32:06 +0100
Richard MUSIL <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux