lkml.org 
[lkml]   [2008]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][Patch 2/5]integrity: TPM internel kernel interface
From
Date
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





\
 
 \ /
  Last update: 2008-05-28 18:15    [W:0.023 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site