Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1204407
| From | yalin wang <yalin.wang2010@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] lib/zlib_inflate:change REVERSE() macro |
| Date | 2015-08-10 18:20 +0200 |
| Message-ID | <pVXXQ-30p-21@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] lib/zlib_inflate:change REVERSE() macro yalin wang <yalin.wang2010@gmail.com> - 2015-08-10 18:20 +0200
csiph-web