From: Timur Tabi <timur@tabi.org>
To: alsa-devel@alsa-project.org, nicoleotsuka@gmail.com
Subject: [PATCH v3] ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()
Date: Fri, 13 Jun 2014 08:18:52 -0500 [thread overview]
Message-ID: <1402665532-15735-1-git-send-email-timur@tabi.org> (raw)
do_div() requires that the first parameter be a 64-bit integer,
but clkrate was defined as an unsigned long. Instead, just use
a normal division. This change fixes the following warnings:
CC sound/soc/fsl/fsl_ssi.o
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':
sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer types lacks a cast
sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type
sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type
include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'long unsigned int *'
Signed-off-by: Timur Tabi <timur@tabi.org>
---
v3: fix grammatical errors in commit message
v2: use normal division instead of do_div
Note: I cannot test this code because I do not have a platform
that runs the SSI in master mode.
sound/soc/fsl/fsl_ssi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 9bfef55..3043d57 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -590,8 +590,8 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
else
clkrate = clk_round_rate(ssi_private->baudclk, tmprate);
- do_div(clkrate, factor);
- afreq = (u32)clkrate / (i + 1);
+ clkrate /= factor;
+ afreq = clkrate / (i + 1);
if (freq == afreq)
sub = 0;
--
1.7.11.7
reply other threads:[~2014-06-13 13:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1402665532-15735-1-git-send-email-timur@tabi.org \
--to=timur@tabi.org \
--cc=alsa-devel@alsa-project.org \
--cc=nicoleotsuka@gmail.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).