From patchwork Fri Nov 20 09:32:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7666151 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD9CDBF90C for ; Fri, 20 Nov 2015 09:33:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 123A02045B for ; Fri, 20 Nov 2015 09:33:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A73F120443 for ; Fri, 20 Nov 2015 09:33:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D692D2665FD; Fri, 20 Nov 2015 10:33:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E74702614C5; Fri, 20 Nov 2015 10:33:06 +0100 (CET) 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 D12722614C5; Fri, 20 Nov 2015 10:33:05 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by alsa0.perex.cz (Postfix) with ESMTP id BD42C261543 for ; Fri, 20 Nov 2015 10:32:54 +0100 (CET) Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0M5fdw-1aJJIt0tzs-00xdM3; Fri, 20 Nov 2015 10:32:47 +0100 From: Arnd Bergmann To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Fri, 20 Nov 2015 10:32:44 +0100 Message-ID: <7580645.enu4DmUPIv@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:8YX5wC7xJDmU1g4wMZhoxdj4A642spvKS/kn2M2j7vm5n3PKS0/ 6R2pOnGW9m7E2SFHuaXJKhKndnJK7cdmXnAA/uGSPrSnMeJ36r2wHZA2VOBdLMdS4IAznmh R8ZCGfa3c+c8wDA1dYozW6quQYUlTyaLSN7AtJ5Uvppe+cA0VoLxzE95Zpjc551YgXOPt+i ZNVyKc9nty072/HJkREYQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:4aodTPxFnxc=:YsMxlTCE3uagASK08BQfDK 4TD/gzEKAOp8p9WkVrKgFZF04ifAR/Pn4J3CTyr9wsQm656nBzMO+zkTD4YX0361Ovn7hj1y4 eOe4c+lgBig/XWPxmb37GRetorCJb4FcHPn1ktZ2FbVA7LERhXOnidKXWh1UafWdB89Ge9j4s R3x1kszIQYDdiVHj9bzVZgSmCSv3Yhyf2rU6R47JUpR7sI+anU2GVwqzVRQhzxELu0k1kfRg5 GhCmnui6GN/VX+MbkniltT+qd2nthtHWWjWwwtPXEeIfHIFu/Wsmt1Er4J196Ce6vUkhvXSVg 6oYDEXRJsXhuyS0f8gcQPuQ35WxZOm6Pexa+iYtpKgrCvJpqLVr/1dLmUkahthK7StMr+7QY2 ixeDR6dtRy9gNLLQix9o8IvIQCdsRVjaBxJvKg19l1+RWf2B714Tf62accwAX6FFwNRhGpslP 0iUkMmpZgT08lHayQ9JVcNZp9hh+U4iQNh481LsyuyNezNyOU9nE94DB5HHKKGtSr5xqV9ESJ gTzmLEJFxEOqYuLWy3OyRupQ3ybSeQfmCuREJy1TgmmabkLsKHDMtOL/L+ogAlKFVev5sJ7U5 QDU+5FV5XSksPONBI+joWN6svvwWCR2Vt8L66dR2Fmv2/yz2mOEvHlA03k/LbIw22D1Cb/lvS Egvj/xhIYK8Q2HG6GqAXGJPpPajELu0fQL9L0be/j+7qcca4B+mbL6UvW543jpChXB8pXXZVo UsBWoqyYEV7YJDas Cc: Leo Yan , linux-kernel@vger.kernel.org, Haojian Zhuang , Liam Girdwood , Daniel Mack , Zhangfei Gao , Robert Jarzmik , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: pxa: remove incorrect do_div() call 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The new optimized do_div implementation (now in asm-generic/next) exposes a glitch in the brownstone audio driver by producing a compile-time warning: sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params': sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow] sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types] The driver just divides two plain integer values, so it should not use do_div to start with, but has apparently done so ever since the code was first merged. This replaces do_div with a simple division operator. Signed-off-by: Arnd Bergmann --- I think this one is harmless, so we only need it in 4.5 to avoid the warning, but not backported to earlier kernels. Found today on ARM allmodconfig diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c index 6147e86e9b0f..416ea646c3b1 100644 --- a/sound/soc/pxa/brownstone.c +++ b/sound/soc/pxa/brownstone.c @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream, sysclk = params_rate(params) * 512; sspa_mclk = params_rate(params) * 64; } - sspa_div = freq_out; - do_div(sspa_div, sspa_mclk); + sspa_div = freq_out / sspa_mclk; snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0); snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);