From: Wolfgang Denk Date: Sat, 17 Dec 2011 21:33:04 +0100 Subject: [U-Boot] [PATCH v1 2/2] tpm: Add i2c TPM driver In-Reply-To: <1323852504-19954-3-git-send-email-clchiou@chromium.org> References: <1323852504-19954-1-git-send-email-clchiou@chromium.org> <1323852504-19954-3-git-send-email-clchiou@chromium.org> Message-ID: <20111217203304.417D21ECC61@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Che-Liang Chiou, In message <1323852504-19954-3-git-send-email-clchiou@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 > Signed-off-by: Che-Liang Chiou ... > + 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@palladium.transmeta.com>