[<prev] [next>] [day] [month] [year] [list]
Message-Id: <8BEB07A0-BF95-4269-AD2F-ED7844A8B20C@gmail.com>
Date: Tue, 11 Aug 2015 00:15:03 +0800
From: yalin wang <yalin.wang2010@...il.com>
To: open list <linux-kernel@...r.kernel.org>
Subject: [PATCH] lib/zlib_inflate:change REVERSE() macro
This patch change REVERSE() macro to use swab32() function,
so that can have more better performance on some platforms.
Signed-off-by: yalin wang <yalin.wang2010@...il.com>
---
lib/zlib_inflate/inflate.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 58a733b..f2b68b6 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -10,6 +10,7 @@
*/
#include <linux/zutil.h>
+#include <linux/swab.h>
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
@@ -228,10 +229,7 @@ static int zlib_inflateSyncPacket(z_streamp strm)
} while (0)
/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
- ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
- (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
+#define REVERSE(q) swab32(q)
/*
inflate() uses a state machine to process as much input data and generate as
much output data as possible before returning. The state machine is
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists