Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759572AbbKTJd1 (ORCPT ); Fri, 20 Nov 2015 04:33:27 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:60712 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbbKTJdY (ORCPT ); Fri, 20 Nov 2015 04:33:24 -0500 From: Arnd Bergmann To: alsa-devel@alsa-project.org, broonie@kernel.org Cc: Robert Jarzmik , Haojian Zhuang , Daniel Mack , Liam Girdwood , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Leo Yan , Zhangfei Gao Subject: [PATCH] ASoC: pxa: remove incorrect do_div() call 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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1805 Lines: 40 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/