public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib : lz4 using put_unaligned_le16 instead of put_unaligned
@ 2014-07-22  2:03 Eunbong Song
  2014-07-22  2:11 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Eunbong Song @ 2014-07-22  2:03 UTC (permalink / raw)
  To: gregkh; +Cc: chanho.min, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1008 bytes --]


In case of mips bigendian machine, put_unaligned writes bigendian bytes order. 
This is defined in arch/mips/include/asm/unaligned.h. So it's right use put_unaligned_le16 function instead of put_unaligned.
This patch also fixes problem fail to mount zram ext4 partition with "zram: Decompression failed! err=-1, page=0" in mips bigendian machine.

Signed-off-by: Eunbong Song <eunb.song@samsung.com>
---
 lib/lz4/lz4defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/lz4/lz4defs.h b/lib/lz4/lz4defs.h
index abcecdc..dc7ef14 100644
--- a/lib/lz4/lz4defs.h
+++ b/lib/lz4/lz4defs.h
@@ -53,7 +53,7 @@ typedef struct _U64_S { u64 v; } U64_S;
 
 #define LZ4_WRITE_LITTLEENDIAN_16(p, v)	\
 	do {	\
-		put_unaligned(v, (u16 *)(p)); \
+		put_unaligned_le16(v, (u16 *)(p)); \
 		p += 2; \
 	} while (0)
 #endif
-- 
1.7.0.1
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-22  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22  2:03 [PATCH] lib : lz4 using put_unaligned_le16 instead of put_unaligned Eunbong Song
2014-07-22  2:11 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox