Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3463164pxb; Mon, 30 Aug 2021 02:56:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmcPCpZaW08WVqfXLRd0nS95H+PVUIZx8P52SdvuC7c/IARlopZKp99/qWQbY+p1IlEHM3 X-Received: by 2002:a92:6a0d:: with SMTP id f13mr16616701ilc.212.1630317394163; Mon, 30 Aug 2021 02:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630317394; cv=none; d=google.com; s=arc-20160816; b=TQfKvJCYEeY206toTqgF42QwlYvlhAcLvvWDU7HuennCXT4h8NeXMOxo2pWop2Vysr 4D97MGdb+pvTDsOtt6gCTqnlvHxU0mMD2mNu8Imgm6j0VbND/tU0GI8x10uUjxRwyLOQ lhJLNie5ltC5Pu6xcNWlRT3WYY1PmQKHld4nYNuttogXXIkg2IsYfFN2dVKPTiZmm+bP 2ptNl4RJFTwZeNhXpLxlIgqosbhSvXYTdLs+TQkfXYgcZCm7j2jlrmVbpu/kWrpBDw1+ zOJQJSMhRZWRIhv6QW87UPAdvLSTB/9axV7qFimJmxWhRiBU1BhzTHQj0m37491kYvUE 2aTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=LPS326pEA3HAxsSJQjoz0JwwwCKCv4ZfAcufRYL+zX8=; b=b+koJAiAMD4sZquJUT/jRgjLYJohHc7nuJeaYXjUxO3yggIs1cQ8+Zs37uOC5yaHTG Y9G3b7hg2Dmuw78qCuGTnE1vLlDoBR6rQQ8msAwpzcguGx4E6zb4pykWoHGyMVUzMU2X RVp4tsTnmb3u5mu5+2+2A8BLIXFHRek37ez99GkevMFzRIYR9XJ0ZGQscAmwMmZUjfZx g3E3mseVWFIS7NaZCXtqn+lb12koRjwEx6KcwVmjB8CV9b6ED9tdbRpLAgD83R31flCR 4uU+CEvr+u28z2UDauewQs8BIkcLVUpKLZ2dzXYL198GScbo3/9QYwKQtmvgpP2Gd4Zc 8vDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si15247880ilm.91.2021.08.30.02.56.23; Mon, 30 Aug 2021 02:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbhH3Jz3 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 30 Aug 2021 05:55:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:48180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbhH3JzX (ORCPT ); Mon, 30 Aug 2021 05:55:23 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57EFE61041; Mon, 30 Aug 2021 09:54:27 +0000 (UTC) Date: Mon, 30 Aug 2021 10:57:38 +0100 From: Jonathan Cameron To: "Sa, Nuno" Cc: Miquel Raynal , Lars-Peter Clausen , Thomas Petazzoni , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH 01/16] iio: adc: max1027: Fix wrong shift with 12-bit devices Message-ID: <20210830105738.472b5f69@jic23-huawei> In-Reply-To: References: <20210818111139.330636-1-miquel.raynal@bootlin.com> <20210818111139.330636-2-miquel.raynal@bootlin.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Aug 2021 07:02:54 +0000 "Sa, Nuno" wrote: > > -----Original Message----- > > From: Miquel Raynal > > Sent: Wednesday, August 18, 2021 1:11 PM > > To: Jonathan Cameron ; Lars-Peter Clausen > > > > Cc: Thomas Petazzoni ; linux- > > iio@vger.kernel.org; linux-kernel@vger.kernel.org; Miquel Raynal > > ; stable@vger.kernel.org > > Subject: [PATCH 01/16] iio: adc: max1027: Fix wrong shift with 12-bit > > devices > > > > [External] > > > > 10-bit devices must shift the value twice. > > This is not needed anymore on 12-bit devices. > > > > Fixes: ae47d009b508 ("iio: adc: max1027: Introduce 12-bit devices > > support") > > Cc: stable@vger.kernel.org > > Signed-off-by: Miquel Raynal > > --- > > drivers/iio/adc/max1027.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c > > index 655ab02d03d8..4a42d140a4b0 100644 > > --- a/drivers/iio/adc/max1027.c > > +++ b/drivers/iio/adc/max1027.c > > @@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, > > max1027_adc_dt_ids); > > .sign = 'u', \ > > .realbits = depth, \ > > .storagebits = 16, \ > > - .shift = 2, \ > > + .shift = (depth == 10) ? 2 : 0, \ > > .endianness = IIO_BE, \ > > }, \ > > } > > -- > > 2.27.0 > > Reviewed-by: Nuno Sá Ouch. I briefly wondered if we should dot his as 12 - depth, but given we are unlikely to ever see a 9 or 11 bit device and it doesn't make much sense for anything 8 or less what you have here is effectively the same. Applied to the fixes-togreg branch of iio.git Jonathan >