This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: i2c: Use div64_ul() for u64-by-unsigned-long divide
Author:  Geert Uytterhoeven <geert+rene...@glider.be>
Date:    Fri Aug 30 10:48:27 2019 -0300

div_u64() does a 64-by-32 division, while the divisor max2175.xtal_freq
is unsigned long, thus 64-bit on 64-bit platforms.  Hence the proper
function to call is div64_ul().

Note that this change does not have any functional impact, as the
crystal frequency must be much lower than the 32-bit limit anyway.
On 32-bit platforms, the generated code is the same.  But at least on
arm64, this saves an AND-instruction to truncate xtal_freq to 32-bit.

Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>
Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>

 drivers/media/i2c/max2175.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

diff --git a/drivers/media/i2c/max2175.c b/drivers/media/i2c/max2175.c
index 19a3ceea3bc2..506a30e69ced 100644
--- a/drivers/media/i2c/max2175.c
+++ b/drivers/media/i2c/max2175.c
@@ -591,8 +591,8 @@ static int max2175_set_lo_freq(struct max2175 *ctx, u32 
lo_freq)
                lo_freq *= lo_mult;
 
        int_desired = lo_freq / ctx->xtal_freq;
-       frac_desired = div_u64((u64)(lo_freq % ctx->xtal_freq) << 20,
-                              ctx->xtal_freq);
+       frac_desired = div64_ul((u64)(lo_freq % ctx->xtal_freq) << 20,
+                               ctx->xtal_freq);
 
        /* Check CSM is not busy */
        ret = max2175_poll_csm_ready(ctx);

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to