archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <>
To: James Bottomley <>
Subject: Re: [PATCH] unaligned: delete 1-byte accessors
Date: Mon, 22 Jul 2019 08:22:44 +0300	[thread overview]
Message-ID: <20190722052244.GA4235@avx2> (raw)
In-Reply-To: <>

On Mon, Jul 22, 2019 at 08:08:33AM +0900, James Bottomley wrote:
> On Mon, 2019-07-22 at 00:52 +0300, Alexey Dobriyan wrote:
> > Each and every 1-byte access is aligned!
> The design idea of this is for parsing descriptors.  We simply chunk up
> the describing structure using get_unaligned for everything.  The
> reason is because a lot of these structures come with reserved areas
> which we may make use of later.  If we're using get_unaligned for
> everything we can simply change a u8 to a u16 in the structure
> absorbing the reserved padding.  With your change now I'd have to chase
> down every byte access and replace it with get_unaligned instead of
> simply changing the structure.
> What's the significant advantage of this change that compensates for
> the problems the above causes?

HW descriptors have fixed endianness, you're supposed to use
get_unaligned_be32() and friends.

For that matter, drivers/scsi/ has exactly 2 get_unaligned() calls one of
which can be changed to get_unaligned_be32().

  reply	other threads:[~2019-07-22  5:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-21 21:52 Alexey Dobriyan
2019-07-21 23:08 ` James Bottomley
2019-07-22  5:22   ` Alexey Dobriyan [this message]
2019-07-22  5:48     ` James Bottomley
2019-07-22  6:07       ` Alexey Dobriyan
2019-07-22  6:20         ` James Bottomley

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:

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

  git send-email \
    --in-reply-to=20190722052244.GA4235@avx2 \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] unaligned: delete 1-byte accessors' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).