public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eunbong Song <eunb.song@samsung.com>
To: gregkh@linuxfoundation.org
Cc: chanho.min@lge.com, linux-kernel@vger.kernel.org
Subject: [PATCH] lib : lz4 using put_unaligned_le16 instead of put_unaligned
Date: Tue, 22 Jul 2014 02:03:23 +0000 (GMT)	[thread overview]
Message-ID: <6506286.203381405994602250.JavaMail.weblogic@epml18> (raw)

[-- 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¥

             reply	other threads:[~2014-07-22  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22  2:03 Eunbong Song [this message]
2014-07-22  2:11 ` [PATCH] lib : lz4 using put_unaligned_le16 instead of put_unaligned Greg KH

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=6506286.203381405994602250.JavaMail.weblogic@epml18 \
    --to=eunb.song@samsung.com \
    --cc=chanho.min@lge.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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