summaryrefslogtreecommitdiffstats
path: root/include/linux/byteorder/generic.h
diff options
context:
space:
mode:
authorEd L. Cashin <ecashin@coraid.com>2005-09-19 19:57:36 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-19 19:57:36 -0700
commite0487992ce1dd7ae7da9c6aabdb19570bb95432b (patch)
treea2d748df1ae99d8f9e6c8e6055e9ef9a3153d1cf /include/linux/byteorder/generic.h
parentff171d8f66a7fe1a000e610e9de11224749f9a22 (diff)
downloadop-kernel-dev-e0487992ce1dd7ae7da9c6aabdb19570bb95432b.zip
op-kernel-dev-e0487992ce1dd7ae7da9c6aabdb19570bb95432b.tar.gz
[BYTEORDER]: Document alignment and byteorder macros
This patch comments the fact that although passing le64_to_cpup et al. is within the intended use of the byteorder macros, using get_unaligned is the recommended way to go. Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/byteorder/generic.h')
-rw-r--r--include/linux/byteorder/generic.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index 5fde6f4..04bd756 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -5,6 +5,10 @@
* linux/byteorder_generic.h
* Generic Byte-reordering support
*
+ * The "... p" macros, like le64_to_cpup, can be used with pointers
+ * to unaligned data, but there will be a performance penalty on
+ * some architectures. Use get_unaligned for unaligned data.
+ *
* Francois-Rene Rideau <fare@tunes.org> 19970707
* gathered all the good ideas from all asm-foo/byteorder.h into one file,
* cleaned them up.
OpenPOWER on IntegriCloud