]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - fs/jffs2/compr_rubin.c
karo: add support for TXA5 (SAMA5D4) modules
[karo-tx-uboot.git] / fs / jffs2 / compr_rubin.c
index cf01f888a47a12b393874d59c7c419ede0ebdd41..9ff2217738261e210d19f5d135e12b266bb5c1ea 100644 (file)
@@ -39,8 +39,6 @@
  */
 
 #include <config.h>
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
 
@@ -48,8 +46,8 @@
 void rubin_do_decompress(unsigned char *bits, unsigned char *in,
                         unsigned char *page_out, __u32 destlen)
 {
-       register char *curr = page_out;
-       char *end = page_out + destlen;
+       register char *curr = (char *)page_out;
+       char *end = (char *)(page_out + destlen);
        register unsigned long temp;
        register unsigned long result;
        register unsigned long p;
@@ -85,8 +83,10 @@ void rubin_do_decompress(unsigned char *bits, unsigned char *in,
                                rec_q <<= 1;
                                rec_q |= (temp >> (bit++ ^ 7)) & 1;
                                if (bit > 31) {
+                                       u32 *p = (u32 *)in;
                                        bit = 0;
-                                       temp = *(++((u32 *) in));
+                                       temp = *(++p);
+                                       in = (unsigned char *)p;
                                }
                        }
                        i0 =  (bits[i] * p) >> 8;
@@ -120,5 +120,3 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
 
        rubin_do_decompress(bits, data_in+8, cpage_out, dstlen);
 }
-
-#endif /* CFG_CMD_JFFS2 */