[U-Boot] [PATCH v1 2/2] tpm: Add i2c TPM driver

Wolfgang Denk wd at denx.de
Sat Dec 17 21:33:04 CET 2011


Dear Che-Liang Chiou,

In message <1323852504-19954-3-git-send-email-clchiou at chromium.org> you wrote:
> Peter Huewe implemented the original driver; this patch only reorganizes
> the code structure of the driver, and does not make logical changes.
> 
> tpm.c implements the interface defined in tpm.h based on underlying
> LPC or i2C TPM driver.  tpm.c and the underlying driver communicate
> throught tpm_private.h.
> 
> This patch is tested on a tegra2-based machine, where the i2c driver is
> not upstreamed yet.
> 
> Note: Merging the LPC driver with tpm.c is left to future patches.
> 
> Signed-off-by: Peter Huewe <peter.huewe at infineon.com>
> Signed-off-by: Che-Liang Chiou <clchiou at chromium.org>

...
> +	if (ordinal < TPM_MAX_ORDINAL)
> +		duration_idx = tpm_ordinal_duration[ordinal];
> +	else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
> +			TPM_MAX_PROTECTED_ORDINAL)
> +		duration_idx = tpm_protected_ordinal_duration[ordinal &
> +			TPM_PROTECTED_ORDINAL_MASK];

Braces needed around multiline statement.

> +	if (duration_idx != TPM_UNDEFINED)
> +		duration = chip->vendor.duration[duration_idx];
> +	if (duration <= 0)

Readability could be improved by inserting a blank line before this
one.

...
> +		debug("%s: waiting for status...\n", __func__);
> +		u8 status = tpm_chip.vendor.status(&tpm_chip);
> +		if ((status & tpm_chip.vendor.req_complete_mask) ==

Please always seaprate declarations and code by one blank line.
Please fix globally.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Yes, it's a technical challenge, and  you  have  to  kind  of  admire
people  who go to the lengths of actually implementing it, but at the
same time you wonder about their IQ...
         --  Linus Torvalds in <5phda5$ml6$1 at palladium.transmeta.com>


More information about the U-Boot mailing list