lib: add support for LZO-compressed kernels
[safe/jmp/linux-2.6] / lib / lzo / lzo1x_decompress.c
index 9dc7056..f2fd098 100644 (file)
  *  Richard Purdie <rpurdie@openedhand.com>
  */
 
+#ifndef STATIC
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/lzo.h>
-#include <asm/byteorder.h>
+#endif
+
 #include <asm/unaligned.h>
+#include <linux/lzo.h>
 #include "lzodefs.h"
 
 #define HAVE_IP(x, ip_end, ip) ((size_t)(ip_end - ip) < (x))
@@ -138,8 +140,7 @@ match:
                                        t += 31 + *ip++;
                                }
                                m_pos = op - 1;
-                               m_pos -= le16_to_cpu(get_unaligned(
-                                       (const unsigned short *)ip)) >> 2;
+                               m_pos -= get_unaligned_le16(ip) >> 2;
                                ip += 2;
                        } else if (t >= 16) {
                                m_pos = op;
@@ -157,8 +158,7 @@ match:
                                        }
                                        t += 7 + *ip++;
                                }
-                               m_pos -= le16_to_cpu(get_unaligned(
-                                       (const unsigned short *)ip) >> 2);
+                               m_pos -= get_unaligned_le16(ip) >> 2;
                                ip += 2;
                                if (m_pos == op)
                                        goto eof_found;
@@ -246,9 +246,10 @@ lookbehind_overrun:
        *out_len = op - out;
        return LZO_E_LOOKBEHIND_OVERRUN;
 }
-
+#ifndef STATIC
 EXPORT_SYMBOL_GPL(lzo1x_decompress_safe);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("LZO1X Decompressor");
 
+#endif