Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/2] nvme: remove spurious use of *_to_cpup helpers
Date: Tue, 18 Aug 2015 07:51:38 +0200	[thread overview]
Message-ID: <20150818055138.GA20959@lst.de> (raw)
In-Reply-To: <20150817201237.GC9645@linux.intel.com>

On Mon, Aug 17, 2015@04:12:37PM -0400, Matthew Wilcox wrote:
> On Mon, Aug 17, 2015@09:09:39PM +0200, Christoph Hellwig wrote:
> > Switch to the normal endianess helpers that take an integer instead of
> > the pointer to it.
> 
> Why?  Some CPUs have a 'load-reversed-endian' instruction, which can be
> used in the _to_cpup() cases, but not in the _to_cpu() cases.

They can and will be used in both cases.

Powerpc examples listings below, as you can see they produce identical code.

------------------ le32_to_cpu ------------------
test.o:     file format elf32-powerpc


Disassembly of section .text:

00000000 <foor>:
};

int foor(struct foo *foo)
{
	return le32_to_cpu(foo->foo);
}
   0:	7c 60 1c 2c 	lwbrx   r3,0,r3
   4:	4e 80 00 20 	blr

------------------ le32_to_cpup ------------------
test.o:     file format elf32-powerpc


Disassembly of section .text:

00000000 <foor>:
};

int foor(struct foo *foo)
{
	return le32_to_cpup(&foo->foo);
}
   0:	7c 60 1c 2c 	lwbrx   r3,0,r3
   4:	4e 80 00 20 	blr

  reply	other threads:[~2015-08-18  5:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-17 19:09 two minor nvme endianess patches Christoph Hellwig
2015-08-17 19:09 ` [PATCH 1/2] nvme: remove spurious use of *_to_cpup helpers Christoph Hellwig
2015-08-17 20:12   ` Matthew Wilcox
2015-08-18  5:51     ` Christoph Hellwig [this message]
2015-08-18 17:51     ` Jens Axboe
2015-08-19  8:16       ` Christoph Hellwig
2015-08-17 19:09 ` [PATCH 2/2] nvme.h: add missing endianess annotations Christoph Hellwig

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=20150818055138.GA20959@lst.de \
    --to=hch@lst.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