From mboxrd@z Thu Jan 1 00:00:00 1970 From: Che-liang Chiou Date: Mon, 19 Dec 2011 17:53:30 +0800 Subject: [U-Boot] [PATCH v1 2/2] tpm: Add i2c TPM driver In-Reply-To: <20111217203304.417D21ECC61@gemini.denx.de> References: <1323852504-19954-1-git-send-email-clchiou@chromium.org> <1323852504-19954-3-git-send-email-clchiou@chromium.org> <20111217203304.417D21ECC61@gemini.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, Dec 18, 2011 at 4:33 AM, Wolfgang Denk wrote: > 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. Done. >> + ? ? 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. Done. > ... >> + ? ? ? ? ? ? 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. Done. I found as many cases as possible, and inserted a few more blank lines. I hope that would increase readability. > > 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>