Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757311AbcLAO6H (ORCPT ); Thu, 1 Dec 2016 09:58:07 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:56834 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbcLAO6G (ORCPT ); Thu, 1 Dec 2016 09:58:06 -0500 Authentication-Results: ppops.net; spf=pass smtp.mailfrom=Brian.Austin@cirrus.com Date: Thu, 1 Dec 2016 08:57:54 -0600 From: Brian Austin X-X-Sender: heelrod@heelroid To: Charles Keepax CC: Florian Vaussard , Brian Austin , Paul Handrigan , , Liam Girdwood , , Florian Vaussard , Takashi Iwai , Mark Brown Subject: Re: [alsa-devel] [PATCH] ASoC: cs42l56: Fix misuse of regmap_update_bits In-Reply-To: <20161201094200.GK1867@localhost.localdomain> References: <1480439449-15975-1-git-send-email-florian.vaussard@heig-vd.ch> <20161201094200.GK1867@localhost.localdomain> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Message-ID: X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com ip4:141.131.128.20 ip4:141.131.3.20 ip4:213.128.236.230 ip4:87.246.98.25 ip4:87.246.78.26 ip4:87.246.76.56 ip4:87.246.98.35 -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612010256 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1072 Lines: 30 On Thu, 1 Dec 2016, Charles Keepax wrote: > On Tue, Nov 29, 2016 at 06:10:49PM +0100, Florian Vaussard wrote: > > Using regmap_update_bits(..., mask, 1) with 'mask' following (1 << k) > > and k greater than 0 is wrong. Indeed, _regmap_update_bits will perform > > (mask & 1), which results in 0 if LSB of mask is 0. Thus the call > > regmap_update_bits(..., mask, 1) is in reality equivalent to > > regmap_update_bits(..., mask, 0). > > > > In such a case, the correct use is regmap_update_bits(..., mask, mask). > > > > This driver is performing such a mistake with the CS42L56_AIN*_REF_MASK > > masks, which equal 0x10, 0x20, 0x40 and 0x80. Fix the driver to make it > > consistent with the API. Please note that this change is untested, > > as I do not have this piece of hardware. Testers are welcome! > > > > Signed-off-by: Florian Vaussard > > --- > > Looks good to me: > > Reviewed-by: Charles Keepax > > Thanks, > Charles > Acked-by: Brian Austin Thanks, Brian