[PATCH] crypto: correct 842 decompress for 32 bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Dan Streetman <ddstreet@xxxxxxxx>
---
 lib/842/842_decompress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c
index dbeb058..999b629 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)
 		/* this is where the current fifo is */
 		u64 section = round_down(total, fsize);
 		/* the current pos in the fifo */
-		u64 pos = total % fsize;
+		u64 pos = total - section;
 
 		/* if the offset is past/at the pos, we need to
 		 * go back to the last fifo section
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux