Skip to content

Commit

Permalink
crypto: hifn_795x - fix 64bit division and undefined __divdi3 on 32bi…
Browse files Browse the repository at this point in the history
…t archs

Commit feb7b7ab928afa97a79a9c424e4e0691f49d63be changed NSEC_PER_SEC to 64-bit
constant, which causes "DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq)" to
generate __divdi3 call on 32-bit archs. Fix this by changing DIV_ROUND_UP to
DIV_ROUND_UP_ULL.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Jussi Kivilinna authored and Herbert Xu committed Jul 30, 2012
1 parent 44a6b84 commit 76f16f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/crypto/hifn_795x.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ static int hifn_register_rng(struct hifn_device *dev)
/*
* We must wait at least 256 Pk_clk cycles between two reads of the rng.
*/
dev->rng_wait_time = DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq) *
256;
dev->rng_wait_time = DIV_ROUND_UP_ULL(NSEC_PER_SEC,
dev->pk_clk_freq) * 256;

dev->rng.name = dev->name;
dev->rng.data_present = hifn_rng_data_present,
Expand Down

0 comments on commit 76f16f8

Please sign in to comment.