public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/8] fs: use get_unaligned_* helpers
Date: Fri, 02 May 2008 11:17:28 -0700	[thread overview]
Message-ID: <1209752248.26173.3.camel@brick> (raw)
In-Reply-To: <481AFDC2.7030807@s5r6.in-berlin.de>

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


      reply	other threads:[~2008-05-02 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02  3:52 [PATCH 7/8] fs: use get_unaligned_* helpers Harvey Harrison
2008-05-02 11:40 ` Stefan Richter
2008-05-02 18:17   ` Harvey Harrison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1209752248.26173.3.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox