From patchwork Thu Dec 19 15:54:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 22640 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95BD023FCA for ; Thu, 19 Dec 2013 15:55:33 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf1423114yho.8 for ; Thu, 19 Dec 2013 07:55:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=mKQ+BA3tN7s+kE4LtHxTTJGApgAyT+kXerjvSaqw6MI=; b=gb6dNR+SbryZ76bZ4dBO2QRyoJDd1xfDDtbXKZnQ7Kp8C/v0mMlAqv7pvEm5fRgBGf W2UeeP6yvxNPqCL+x2HGTXcdv/6Drcrr0+AcshXC9K+5FliExxTD0/oBvSgLz4f8XCC1 EaKSGCg6DCsjQFGAgAOqI4Xh+BjRelXnKlJGBF+Q0pPARpq/7UmZJ1i8tUrREY/4hXCo q0kTPHE8cyUUsP8Rw3f+6Ou53kg7ziH135H5r6+xietefpf5Xg6oljbw4hzlvw8+42VC /oES3yH6MYUIS13B1WL20GbLqEYjalyoHYiLHwnq/o5N0C8L0VG01dO5BA5iAL84qlrH qHGA== X-Gm-Message-State: ALoCoQkoCUDLyTFeP5/gtS6usO2lGgmQFwQAbdbNkQoEklkX2GTpyqPOlNPiRwSaZ2VTiaucO/vW X-Received: by 10.58.154.5 with SMTP id vk5mr1059984veb.32.1387468532809; Thu, 19 Dec 2013 07:55:32 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.106.70 with SMTP id gs6ls395590qeb.17.gmail; Thu, 19 Dec 2013 07:55:32 -0800 (PST) X-Received: by 10.58.46.171 with SMTP id w11mr1343256vem.5.1387468532399; Thu, 19 Dec 2013 07:55:32 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id ti3si780876vdc.41.2013.12.19.07.55.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id x11so745438vbb.36 for ; Thu, 19 Dec 2013 07:55:32 -0800 (PST) X-Received: by 10.58.118.36 with SMTP id kj4mr1382585veb.2.1387468532280; Thu, 19 Dec 2013 07:55:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp331334ved; Thu, 19 Dec 2013 07:55:31 -0800 (PST) X-Received: by 10.194.201.225 with SMTP id kd1mr2100742wjc.35.1387468531296; Thu, 19 Dec 2013 07:55:31 -0800 (PST) Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by mx.google.com with ESMTPS id i13si1883955wiv.63.2013.12.19.07.55.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:31 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.51 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.51; Received: by mail-wg0-f51.google.com with SMTP id b13so1247150wgh.6 for ; Thu, 19 Dec 2013 07:55:30 -0800 (PST) X-Received: by 10.194.20.230 with SMTP id q6mr2095447wje.49.1387468530751; Thu, 19 Dec 2013 07:55:30 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id ko3sm279236wjb.23.2013.12.19.07.55.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:30 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, broonie@kernel.org, alsa-devel@alsa-project.org, Lee Jones , Takashi Iwai Subject: [PATCH 02/11] ASoC: ab8500: Revert back to find_next_bit() Date: Thu, 19 Dec 2013 15:54:59 +0000 Message-Id: <1387468508-12286-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387468508-12286-1-git-send-email-lee.jones@linaro.org> References: <1387468508-12286-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit '166a34d ASoC: ab8500: Fix invalid cast to long pointer' rather carelessly converts find_next_bit() to fls() (find last bit set), which are not the same. Although this implementation may not be portable, the alternative breaks audio on anything using the AB8500 CODEC, which is a much greater evil. Besides, this driver will never run on anything else. Cc: Takashi Iwai Signed-off-by: Lee Jones --- sound/soc/codecs/ab8500-codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 1ad92cb..51ae3e9 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c @@ -2322,7 +2322,7 @@ static int ab8500_codec_set_dai_tdm_slot(struct snd_soc_dai *dai, slot = ffs(tx_mask); snd_soc_update_bits(codec, AB8500_DASLOTCONF1, mask, slot); snd_soc_update_bits(codec, AB8500_DASLOTCONF3, mask, slot); - slot = fls(tx_mask); + slot = find_next_bit((unsigned long *)&tx_mask, 32, slot + 1); snd_soc_update_bits(codec, AB8500_DASLOTCONF2, mask, slot); snd_soc_update_bits(codec, AB8500_DASLOTCONF4, mask, slot); break; @@ -2364,7 +2364,7 @@ static int ab8500_codec_set_dai_tdm_slot(struct snd_soc_dai *dai, AB8500_ADSLOTSEL(slot), AB8500_MASK_SLOT(slot), AB8500_ADSLOTSELX_AD_OUT_TO_SLOT(AB8500_AD_OUT3, slot)); - slot = fls(rx_mask); + slot = find_next_bit((unsigned long *)&rx_mask, 32, slot + 1); snd_soc_update_bits(codec, AB8500_ADSLOTSEL(slot), AB8500_MASK_SLOT(slot),