Skip to content

Commit

Permalink
lib: correct 842 decompress for 32 bit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dan Streetman <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ddstreet authored and herbertx committed May 13, 2015
1 parent 42e8b0d commit ca7fc7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/842/842_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca7fc7e

Please sign in to comment.