From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] Introduce generic TPM support in u-boot
Date: Sat, 15 Oct 2011 15:42:45 -0400 [thread overview]
Message-ID: <201110151542.46102.vapier@gentoo.org> (raw)
In-Reply-To: <20111015033850.74AD5419FF@eskimo.mtv.corp.google.com>
On Friday 14 October 2011 23:38:50 Vadim Bendebury wrote:
> --- /dev/null
> +++ b/drivers/tpm/generic_lpc_tpm.c
>
> +#define TPM_TIMEOUT_ERR (~0)
> +#define TPM_DRIVER_ERR (-1)
these are the same thing. another reason why you shouldn't mix ~ with normal
values. use -2 or something.
> +/* TPM access going through macros to make tracing easier. */
> +#define tpm_read(ptr) ({ \
> + u32 __ret; \
> + __ret = (sizeof(*ptr) == 1) ? readb(ptr) : readl(ptr); \
> + debug(PREFIX "Read reg 0x%x returns 0x%x\n", \
> + (u32)ptr - (u32)lpc_tpm_dev, __ret); \
> + __ret; })
that last "__ret;" is indented way too far. it should be on the same level as
"u32 __ret;" and such.
> +#define tpm_write(value, ptr) ({ \
> + u32 __v = value; \
> + debug(PREFIX "Write reg 0x%x with 0x%x\n", \
> + (u32)ptr - (u32)lpc_tpm_dev, __v); \
> + if (sizeof(*ptr) == 1) \
> + writeb(__v, ptr); \
> + else \
> + writel(__v, ptr); })
({...}) doesn't make sense here. this should be a do{...}while(0).
> + printf("%s:%d - failed to get 'command_ready' status\n",
> + __FILE__, __LINE__);
replace __FILE__/__LINE__ with __func__ here and everywhere else in the file
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111015/8a57dc5a/attachment.pgp
next prev parent reply other threads:[~2011-10-15 19:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-15 3:38 [U-Boot] [PATCH v2 1/2] Introduce generic TPM support in u-boot Vadim Bendebury
2011-10-15 18:08 ` Marek Vasut
2011-10-15 18:47 ` Vadim Bendebury
2011-10-15 21:09 ` Marek Vasut
2011-10-16 1:04 ` Vadim Bendebury
2011-10-16 3:31 ` Marek Vasut
2011-10-16 3:45 ` Vadim Bendebury
2011-10-16 7:35 ` Wolfgang Denk
2011-10-16 14:57 ` Vadim Bendebury
2011-10-16 20:04 ` Wolfgang Denk
2011-10-16 20:24 ` Vadim Bendebury
2011-10-16 20:31 ` Wolfgang Denk
2011-10-16 20:42 ` Vadim Bendebury
2011-10-16 20:53 ` Wolfgang Denk
2011-10-16 21:53 ` Vadim Bendebury
2011-10-16 12:28 ` Marek Vasut
2011-10-16 19:49 ` Vadim Bendebury
2011-10-17 11:01 ` Marek Vasut
2011-10-16 6:15 ` Wolfgang Denk
2011-10-16 15:31 ` Mike Frysinger
2011-10-15 19:25 ` Wolfgang Denk
2011-10-16 1:05 ` Vadim Bendebury
2011-10-15 19:42 ` Mike Frysinger [this message]
2011-10-15 20:23 ` Vadim Bendebury
2011-10-16 1:06 ` Vadim Bendebury
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201110151542.46102.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox