summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/lzo/lzo1x_compress.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/lzo/lzo1x_compress.c b/lib/lzo/lzo1x_compress.c
index ba16c08e8cb9..717c940112f9 100644
--- a/lib/lzo/lzo1x_compress.c
+++ b/lib/lzo/lzo1x_compress.c
@@ -83,17 +83,19 @@ next:
83 ALIGN((uintptr_t)ir, 4)) && 83 ALIGN((uintptr_t)ir, 4)) &&
84 (ir < limit) && (*ir == 0)) 84 (ir < limit) && (*ir == 0))
85 ir++; 85 ir++;
86 for (; (ir + 4) <= limit; ir += 4) { 86 if (IS_ALIGNED((uintptr_t)ir, 4)) {
87 dv = *((u32 *)ir); 87 for (; (ir + 4) <= limit; ir += 4) {
88 if (dv) { 88 dv = *((u32 *)ir);
89 if (dv) {
89# if defined(__LITTLE_ENDIAN) 90# if defined(__LITTLE_ENDIAN)
90 ir += __builtin_ctz(dv) >> 3; 91 ir += __builtin_ctz(dv) >> 3;
91# elif defined(__BIG_ENDIAN) 92# elif defined(__BIG_ENDIAN)
92 ir += __builtin_clz(dv) >> 3; 93 ir += __builtin_clz(dv) >> 3;
93# else 94# else
94# error "missing endian definition" 95# error "missing endian definition"
95# endif 96# endif
96 break; 97 break;
98 }
97 } 99 }
98 } 100 }
99#endif 101#endif