All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: correct 842 decompress for 32 bit
@ 2015-05-11 22:53 Dan Streetman
  2015-05-13  3:20 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Streetman @ 2015-05-11 22:53 UTC (permalink / raw)
  To: Linux Crypto Mailing List; +Cc: Dan Streetman, Herbert Xu, Fengguang Wu

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(-)

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: correct 842 decompress for 32 bit
  2015-05-11 22:53 [PATCH] crypto: correct 842 decompress for 32 bit Dan Streetman
@ 2015-05-13  3:20 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-05-13  3:20 UTC (permalink / raw)
  To: Dan Streetman; +Cc: Linux Crypto Mailing List, Fengguang Wu

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.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-13  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 22:53 [PATCH] crypto: correct 842 decompress for 32 bit Dan Streetman
2015-05-13  3:20 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.