From patchwork Fri Jun 13 13:18:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 4349101 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D57A79F314 for ; Fri, 13 Jun 2014 13:19:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E778220254 for ; Fri, 13 Jun 2014 13:19:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 77F932022A for ; Fri, 13 Jun 2014 13:19:20 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 35CF6261A0E; Fri, 13 Jun 2014 15:19:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 828A72610A7; Fri, 13 Jun 2014 15:19:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DD7272610AE; Fri, 13 Jun 2014 15:19:03 +0200 (CEST) Received: from cdptpa-oedge-vip.email.rr.com (cdptpa-outbound-snat.email.rr.com [107.14.166.226]) by alsa0.perex.cz (Postfix) with ESMTP id A1E16260815 for ; Fri, 13 Jun 2014 15:18:55 +0200 (CEST) Received: from [72.177.12.12] ([72.177.12.12:48882] helo=linux.austin.rr.com) by cdptpa-oedge03 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 2A/58-16046-E3AFA935; Fri, 13 Jun 2014 13:18:54 +0000 From: Timur Tabi To: alsa-devel@alsa-project.org, nicoleotsuka@gmail.com Date: Fri, 13 Jun 2014 08:18:52 -0500 Message-Id: <1402665532-15735-1-git-send-email-timur@tabi.org> X-Mailer: git-send-email 1.7.11.7 X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Subject: [alsa-devel] [PATCH v3] ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;