From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AAA8C3A5A3 for ; Tue, 27 Aug 2019 20:03:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE4FA217F5 for ; Tue, 27 Aug 2019 20:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730968AbfH0UDS (ORCPT ); Tue, 27 Aug 2019 16:03:18 -0400 Received: from saturn.retrosnub.co.uk ([46.235.226.198]:44712 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730221AbfH0UDS (ORCPT ); Tue, 27 Aug 2019 16:03:18 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) by saturn.retrosnub.co.uk (Postfix; Retrosnub mail submission) with ESMTPSA id 2F1169E75AC; Tue, 27 Aug 2019 21:03:16 +0100 (BST) Date: Tue, 27 Aug 2019 21:03:14 +0100 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "Popa, Stefan Serban" , "linux-iio@vger.kernel.org" , "colin.king@canonical.com" , "Hennerich, Michael" , "lars@metafoo.de" , "knaack.h@gmx.de" , "pmeerw@pmeerw.net" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] iio: dac: ad5380: fix incorrect assignment to val Message-ID: <20190827210314.24887407@archlinux> In-Reply-To: <20190818185544.66c32add@archlinux> References: <20190815115846.21800-1-colin.king@canonical.com> <876a4d5190828619f75365863cc6bf2cfea4ffea.camel@analog.com> <20190818185544.66c32add@archlinux> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sun, 18 Aug 2019 18:55:44 +0100 Jonathan Cameron wrote: > On Fri, 16 Aug 2019 06:16:26 +0000 > "Ardelean, Alexandru" wrote: > > > On Thu, 2019-08-15 at 12:58 +0100, Colin King wrote: > > > [External] > > > > > > > Reviewed-by: Alexandru Ardelean > Applied to the fixes-togreg branch of iio.git. I changed my mind on this because I've been a bit slow sending a pull request and we are now at rc6. Hence I've cherry picked it into togreg so it'll go in during the next merge window and get backported at that point. Thanks, Jonathan > > Thanks, > > Jonathan > > > > > > From: Colin Ian King > > > > > > Currently the pointer val is being incorrectly incremented > > > instead of the value pointed to by val. Fix this by adding > > > in the missing * indirection operator. > > > > > > Addresses-Coverity: ("Unused value") > > > Fixes: c03f2c536818 ("staging:iio:dac: Add AD5380 driver") > > > Signed-off-by: Colin Ian King > > > --- > > > drivers/iio/dac/ad5380.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c > > > index 4335214800d2..2ebe08326048 100644 > > > --- a/drivers/iio/dac/ad5380.c > > > +++ b/drivers/iio/dac/ad5380.c > > > @@ -220,7 +220,7 @@ static int ad5380_read_raw(struct iio_dev *indio_dev, > > > if (ret) > > > return ret; > > > *val >>= chan->scan_type.shift; > > > - val -= (1 << chan->scan_type.realbits) / 2; > > > + *val -= (1 << chan->scan_type.realbits) / 2; > > > return IIO_VAL_INT; > > > case IIO_CHAN_INFO_SCALE: > > > *val = 2 * st->vref; >