Messages in this thread Patch in this message | | | From | yalin wang <> | Subject | [PATCH] lib/zlib_inflate:change REVERSE() macro | Date | Tue, 11 Aug 2015 00:15:03 +0800 |
| |
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@gmail.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
| |