Message ID | 1431384816-21606-1-git-send-email-ddstreet@ieee.org (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
On Mon, May 11, 2015 at 06:53:36PM -0400, Dan Streetman wrote: > 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> Applied.
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
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> --- lib/842/842_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)