Messages in this thread | | | Subject | Re: [RFC][Patch 2/5]integrity: TPM internel kernel interface | From | Harvey Harrison <> | Date | Wed, 28 May 2008 09:12:12 -0700 |
| |
On Wed, 2008-05-28 at 00:17 -0700, Andrew Morton wrote: > On Fri, 23 May 2008 11:03:41 -0400 Mimi Zohar <zohar@linux.vnet.ibm.com> wrote: > > + index = cpu_to_be32(pcr_idx); > > + memcpy(data + 10, &index, 4); > > + rc = tpm_transmit(chip, data, sizeof(data)); > > + if (rc > 0) > > + rc = be32_to_cpu(*((u32 *) (data + 6))); > > An unaligned access. What architectures is this hardware available on? > > Harvey might be able to suggest a neater and better way of doing this? > At least a get_unaligned(), I think? >
rc = get_unaligned_be32((__be32 *)(data + 6));
If it was aligned:
rc = be32_to_cpup((__be32 *)(data + 6));
Cheers,
Harvey
| |