diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-03-04 09:03:50 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-03-04 09:03:50 +0000 |
commit | 3ee484d54c77f469528ee839c45189e7cd3d4db9 (patch) | |
tree | 6502bd6668a33fb7309642998668aaf6ee8b037d /target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch | |
parent | d5adb0dbdd93473fdc0e083f932f8da467e63bc6 (diff) | |
download | upstream-3ee484d54c77f469528ee839c45189e7cd3d4db9.tar.gz upstream-3ee484d54c77f469528ee839c45189e7cd3d4db9.tar.bz2 upstream-3ee484d54c77f469528ee839c45189e7cd3d4db9.zip |
ar71xx: remove 3.7 support
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35870
Diffstat (limited to 'target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch')
-rw-r--r-- | target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch b/target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch deleted file mode 100644 index b302571228..0000000000 --- a/target/linux/ar71xx/patches-3.7/310-lib-add-rle-decompression.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- a/lib/Kconfig -+++ b/lib/Kconfig -@@ -194,6 +194,9 @@ config LZMA_COMPRESS - config LZMA_DECOMPRESS - tristate - -+config RLE_DECOMPRESS -+ tristate -+ - # - # These all provide a common interface (hence the apparent duplication with - # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.) ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -85,6 +85,7 @@ obj-$(CONFIG_XZ_DEC) += xz/ - obj-$(CONFIG_RAID6_PQ) += raid6/ - obj-$(CONFIG_LZMA_COMPRESS) += lzma/ - obj-$(CONFIG_LZMA_DECOMPRESS) += lzma/ -+obj-$(CONFIG_RLE_DECOMPRESS) += rle.o - - lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o - lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o ---- /dev/null -+++ b/include/linux/rle.h -@@ -0,0 +1,8 @@ -+#ifndef _RLE_H_ -+#define _RLE_H_ -+ -+int rle_decode(const unsigned char *src, size_t srclen, -+ unsigned char *dst, size_t dstlen, -+ size_t *src_done, size_t *dst_done); -+ -+#endif /* _RLE_H_ */ ---- /dev/null -+++ b/lib/rle.c -@@ -0,0 +1,78 @@ -+/* -+ * RLE decoding routine -+ * -+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org> -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published -+ * by the Free Software Foundation. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/module.h> -+#include <linux/rle.h> -+ -+int rle_decode(const unsigned char *src, size_t srclen, -+ unsigned char *dst, size_t dstlen, -+ size_t *src_done, size_t *dst_done) -+{ -+ size_t srcpos, dstpos; -+ int ret; -+ -+ srcpos = 0; -+ dstpos = 0; -+ ret = -EINVAL; -+ -+ /* sanity checks */ -+ if (!src || !srclen || !dst || !dstlen) -+ goto out; -+ -+ while (1) { -+ char count; -+ -+ if (srcpos >= srclen) -+ break; -+ -+ count = (char) src[srcpos++]; -+ if (count == 0) { -+ ret = 0; -+ break; -+ } -+ -+ if (count > 0) { -+ unsigned char c; -+ -+ if (srcpos >= srclen) -+ break; -+ -+ c = src[srcpos++]; -+ -+ while (count--) { -+ if (dstpos >= dstlen) -+ break; -+ -+ dst[dstpos++] = c; -+ } -+ } else { -+ count *= -1; -+ -+ while (count--) { -+ if (srcpos >= srclen) -+ break; -+ if (dstpos >= dstlen) -+ break; -+ dst[dstpos++] = src[srcpos++]; -+ } -+ } -+ } -+ -+out: -+ if (src_done) -+ *src_done = srcpos; -+ if (dst_done) -+ *dst_done = dstpos; -+ -+ return ret; -+} -+ -+EXPORT_SYMBOL_GPL(rle_decode); |