[SLOF] [PATCH 02/16] Add TPM initialization support
Stefan Berger
stefanb at linux.vnet.ibm.com
Thu Nov 12 05:56:20 AEDT 2015
On 11/09/2015 03:29 AM, Nikunj A Dadhania wrote:
> Stefan Berger <stefanb at linux.vnet.ibm.com> writes:
>
>
> This will be do { if (0) { printf (); } } while(0);
>
> which i assume compiler can optimize, but as suggested in earlier patch
> can we make it more explicit ?
>
> Variable names look foreign in the SLOF code !
Is it the camel case? I can remove that. Or the fact that they use a
mixture of lower and upper case? I find upper case constants in some
parts of the code and lower case constants and then things like
keycode_alt_GR (usb-key.c). If I insert _ before a upper case letter, is
that sufficient ?
>
>> +
>> +static const uint8_t Startup_ST_CLEAR[] = { 0x00, TPM_ST_CLEAR };
>> +static const uint8_t Startup_ST_STATE[] = { 0x00, TPM_ST_STATE };
>> +
>> +static const uint8_t PhysicalPresence_CMD_ENABLE[] = { 0x00, 0x20 };
>> +static const uint8_t PhysicalPresence_CMD_DISABLE[] = { 0x01, 0x00 };
>> +static const uint8_t PhysicalPresence_PRESENT[] = { 0x00, 0x08 };
>> +static const uint8_t PhysicalPresence_NOT_PRESENT_LOCK[] = { 0x00, 0x14 };
>> +
>> +static const uint8_t CommandFlag_FALSE[] = { 0x00 };
>> +static const uint8_t CommandFlag_TRUE[] = { 0x01 };
>> +
>> +static const uint8_t GetCapability_Permanent_Flags[] = {
>> + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04,
>> + 0x00, 0x00, 0x01, 0x08
>> +};
>> +
>> +static const uint8_t GetCapability_OwnerAuth[] = {
>> + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04,
>> + 0x00, 0x00, 0x01, 0x11
>> +};
>> +
>> +static const uint8_t GetCapability_Timeouts[] = {
>> + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04,
>> + 0x00, 0x00, 0x01, 0x15
>> +};
>> +
>> +static const uint8_t GetCapability_Durations[] = {
>> + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04,
>> + 0x00, 0x00, 0x01, 0x20
>> +};
Stefan
More information about the SLOF
mailing list