aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2014-02-05 08:42:28 +0000
committerZoltan HERPAI <wigyori@uid0.hu>2014-02-05 08:42:28 +0000
commitd1ca9d207acc1056bd460f7cba2f50af87004f58 (patch)
tree3ec56a328c48048eb595e971cf2f7f51e73404ed /target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch
parent1dd76f71e1aa7e8dae83aed641ac527ac4f8fadd (diff)
downloadmaster-187ad058-d1ca9d207acc1056bd460f7cba2f50af87004f58.tar.gz
master-187ad058-d1ca9d207acc1056bd460f7cba2f50af87004f58.tar.bz2
master-187ad058-d1ca9d207acc1056bd460f7cba2f50af87004f58.zip
sunxi: initial 3.13 support
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39471 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch')
-rw-r--r--target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch b/target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch
new file mode 100644
index 0000000000..4f04d54151
--- /dev/null
+++ b/target/linux/sunxi/patches-3.13/101-fix-off-by-one-masks.patch
@@ -0,0 +1,34 @@
+From b3cb099f8b0cbe56fcfbb4fb9c7cce48afff41f0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <emilio@elopez.com.ar>
+Date: Fri, 20 Sep 2013 22:03:10 -0300
+Subject: [PATCH] clk: sunxi: factors: fix off-by-one masks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The previous code would generate one bit too long masks, and was
+needlessly complicated. This patch replaces it by simpler code that can
+generate the masks correctly.
+
+Signed-off-by: Emilio López <emilio@elopez.com.ar>
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ drivers/clk/sunxi/clk-factors.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c
+index 88523f9..5687ac9 100644
+--- a/drivers/clk/sunxi/clk-factors.c
++++ b/drivers/clk/sunxi/clk-factors.c
+@@ -40,7 +40,7 @@ struct clk_factors {
+
+ #define to_clk_factors(_hw) container_of(_hw, struct clk_factors, hw)
+
+-#define SETMASK(len, pos) (((-1U) >> (31-len)) << (pos))
++#define SETMASK(len, pos) (((1U << (len)) - 1) << (pos))
+ #define CLRMASK(len, pos) (~(SETMASK(len, pos)))
+ #define FACTOR_GET(bit, len, reg) (((reg) & SETMASK(len, bit)) >> (bit))
+
+--
+1.8.5.1
+