linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gianluca Gennari <gennarone@gmail.com>
To: linux-media@vger.kernel.org, crope@iki.fi
Cc: mchehab@redhat.com, Gianluca Gennari <gennarone@gmail.com>
Subject: [PATCH 3/3] fc2580: use macro for 64 bit division and reminder
Date: Mon, 24 Sep 2012 13:37:18 +0200	[thread overview]
Message-ID: <1348486638-31169-4-git-send-email-gennarone@gmail.com> (raw)
In-Reply-To: <1348486638-31169-1-git-send-email-gennarone@gmail.com>

Fixes the following warnings on a 32 bit system with GCC 4.4.3 and kernel Ubuntu 2.6.32-43 32 bit:

WARNING: "__udivdi3" [fc2580.ko] undefined!
WARNING: "__umoddi3" [fc2580.ko] undefined!

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/tuners/fc2580.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c
index 3ad68e9..2e8ebac 100644
--- a/drivers/media/tuners/fc2580.c
+++ b/drivers/media/tuners/fc2580.c
@@ -168,8 +168,7 @@ static int fc2580_set_params(struct dvb_frontend *fe)
 	}
 
 	f_ref = 2UL * priv->cfg->clock / r_val;
-	n_val = f_vco / f_ref;
-	k_val = f_vco % f_ref;
+	n_val = div_u64_rem(f_vco, f_ref, &k_val);
 	k_val_reg = 1UL * k_val * (1 << 20) / f_ref;
 
 	ret = fc2580_wr_reg(priv, 0x18, r18_val | ((k_val_reg >> 16) & 0xff));
-- 
1.7.0.4


  parent reply	other threads:[~2012-09-24 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 11:37 [PATCH 0/3] Fix several warnings on new fc2580 tuner driver Gianluca Gennari
2012-09-24 11:37 ` [PATCH 1/3] fc2580: define const as UL to silence a warning Gianluca Gennari
2012-09-24 11:52   ` Antti Palosaari
2012-09-24 11:37 ` [PATCH 2/3] fc2580: silence uninitialized variable warning Gianluca Gennari
2012-09-24 11:55   ` Antti Palosaari
2012-09-24 11:37 ` Gianluca Gennari [this message]
2012-09-24 11:55   ` [PATCH 3/3] fc2580: use macro for 64 bit division and reminder Antti Palosaari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348486638-31169-4-git-send-email-gennarone@gmail.com \
    --to=gennarone@gmail.com \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).