diff options
author | Dan Streetman <ddstreet@ieee.org> | 2015-05-11 18:53:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-12 22:31:59 -0400 |
commit | ca7fc7e962fa067ba31f76a6e5828537394f6481 (patch) | |
tree | e79e641598fdf90d30a76f9c761ab5041019f971 | |
parent | 42e8b0d7fed0628e21ec93e8cd547aef616e68f7 (diff) |
lib: correct 842 decompress for 32 bit
Avoid 64 bit mod operation, which won't work on 32 bit systems.
Simple subtraction can be used instead in this case.
Reported-By: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | lib/842/842_decompress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c index dbeb0581b879..5446ff0c9ba0 100644 --- a/lib/842/842_decompress.c +++ b/lib/842/842_decompress.c | |||
@@ -185,7 +185,7 @@ static int __do_index(struct sw842_param *p, u8 size, u8 bits, u64 fsize) | |||
185 | /* this is where the current fifo is */ | 185 | /* this is where the current fifo is */ |
186 | u64 section = round_down(total, fsize); | 186 | u64 section = round_down(total, fsize); |
187 | /* the current pos in the fifo */ | 187 | /* the current pos in the fifo */ |
188 | u64 pos = total % fsize; | 188 | u64 pos = total - section; |
189 | 189 | ||
190 | /* if the offset is past/at the pos, we need to | 190 | /* if the offset is past/at the pos, we need to |
191 | * go back to the last fifo section | 191 | * go back to the last fifo section |