[U-Boot] [PATCH v2 2/2] Add a cli command to test the TPM device.

Mike Frysinger vapier at gentoo.org
Sat Oct 15 21:13:51 CEST 2011


On Friday 14 October 2011 23:39:08 Vadim Bendebury wrote:
> --- /dev/null
> +++ b/common/cmd_tpm.c
>
> +	/*
> +	 * Verify that in case it is present, the first argument, it is
> +	 * exactly one character in size.
> +	 */
> +	if (argc < 7) {
> +		puts("command should be at least six bytes in size\n");
> +		return ~0;
> +	}
> ...
> +U_BOOT_CMD(tpm, MAX_TRANSACTION_SIZE, 1, do_tpm,
> +	   "tpm <data> [<data>]   - write data and read ressponse\n",

the usage information does not convey that you have to do:
	tpm 1 2 3 4 5 6 7 8 9
perhaps says "<byte> [<byte> ...]" instead ?  and note that you have to 
specify at least 6 ?

also, there's a typo: ressponse -> response

> +static void report_error(const char *msg)
> +{
> +	if (msg && *msg)
> +		printf("%s\n", msg);
> +	cmd_usage(&__u_boot_cmd_tpm);
> +}

this gets used in one place, and the one place where it does get used, i don't 
see a point in calling cmd_usage().  just have the one place where this is 
used call puts() instead.
-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/af49390d/attachment.pgp 


More information about the U-Boot mailing list