lkml.org 
[lkml]   [2008]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 7/8] fs: use get_unaligned_* helpers
From
Date
On Fri, 2008-05-02 at 13:40 +0200, Stefan Richter wrote:
> Harvey Harrison wrote:
> > fs/partitions/ldm.h | 6 +++---
> > 1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/partitions/ldm.h b/fs/partitions/ldm.h
> ...
> > /* Most numbers we deal with are big-endian and won't be aligned. */
> > -#define BE16(x) ((u16)be16_to_cpu(get_unaligned((__be16*)(x))))
> > -#define BE32(x) ((u32)be32_to_cpu(get_unaligned((__be32*)(x))))
> > -#define BE64(x) ((u64)be64_to_cpu(get_unaligned((__be64*)(x))))
> > +#define BE16(x) get_unaligned_be16((x))
> > +#define BE32(x) get_unaligned_be32((x))
> > +#define BE64(x) get_unaligned_be64((x))
>
> Why the double parentheses?

No reason.

>
> More importantly, I would say ldm.c should rather use
> get_unaligned_be*() directly. No need to hide what these macros are
> about by using a local alias.

Done, will send out a revised set.

>
> After that, ldm.c should be inspected for whether really all of the
> accesses are unaligned. If there are any which are guaranteed to be
> aligned, they should of course be turned into be*_to_cpu(). But
> separately from this conversion to get_unaligned_be*().

It looks like they are all needed from a quick inspection, the comments
seem to suggest that lots of the accesses will be unaligned.

Cheers,

Harvey



\
 
 \ /
  Last update: 2008-05-02 20:21    [W:0.216 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site