On 12/02/2014 05:31 PM, Jarkko Sakkinen wrote:
> +
> +#define TPM2_STARTUP_IN_SIZE \
> +     (sizeof(struct tpm_input_header) + \
> +      sizeof(struct tpm2_pcr_read_in))
> +
> +static const struct tpm_input_header tpm2_startup_header = {
> +     .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
> +     .length = cpu_to_be32(TPM2_STARTUP_IN_SIZE),
> +     .ordinal = cpu_to_be32(TPM2_CC_STARTUP)
> +};
> +
>
[...]
> +
> +#define TPM2_PCR_READ_IN_SIZE \
> +     (sizeof(struct tpm_input_header) + \
> +      sizeof(struct tpm2_pcr_read_in))
> +
> +static const struct tpm_input_header tpm2_pcrread_header = {
> +     .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
> +     .length = cpu_to_be32(TPM2_PCR_READ_IN_SIZE),
> +     .ordinal = cpu_to_be32(TPM2_CC_PCR_READ)
> +};
> +
>
[...]
> +static const struct tpm_input_header tpm2_pcrextend_header = {
> +     .tag = cpu_to_be16(TPM2_ST_SESSIONS),
> +     .length = cpu_to_be32(sizeof(struct tpm_input_header) +
> +                           sizeof(struct tpm2_pcr_extend_in)),
> +     .ordinal = cpu_to_be32(TPM2_CC_PCR_EXTEND)
> +};


really just a nit: also use a #define here



> +static const struct tpm_input_header tpm2_getrandom_header = {
> +     .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
> +     .length = cpu_to_be32(sizeof(struct tpm_input_header) +
> +                           sizeof(struct tpm2_get_random_in)),
> +     .ordinal = cpu_to_be32(TPM2_CC_GET_RANDOM)
> +};
> +
also here

> +
> +#define TPM2_GET_TPM_PT_IN_SIZE \
> +     (sizeof(struct tpm_input_header) + \
> +      sizeof(struct tpm2_get_tpm_pt_in))
> +
> +static const struct tpm_input_header tpm2_get_tpm_pt_header = {
> +     .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
> +     .length = cpu_to_be32(TPM2_GET_TPM_PT_IN_SIZE),
> +     .ordinal = cpu_to_be32(TPM2_CC_GET_CAPABILITY)
> +};
> +


Otherwise it looks good now.

    Stefan


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to