Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp568753imd; Sat, 3 Nov 2018 06:08:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5fIrSsD3RhcX6krA0E+22F+GQ5VyUUzFSTUdPFjoivnb0CqDHVTAHovr6XFUndwH5GquGWj X-Received: by 2002:a63:d547:: with SMTP id v7mr13950922pgi.339.1541250489029; Sat, 03 Nov 2018 06:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541250488; cv=none; d=google.com; s=arc-20160816; b=axBeUAlTpCUjuIrdOiljMT68qkJXntHrhSfuZBqdP+1PPFaFlal04/6i404kT2UaRP a2HUIoLZvnpahouqz/y2ialWJmH6uPi4CgfaEbYBz2GNYz9wZVczUFojsdMgF1zQbUxj 81EBOnEXk/u7WPAtjG96llMcfyMUWN1mWVu/9x9BDKaJ0PAnQWiag8oPJEO2xHLp8RW6 WCblaRaiFl+PEjJz5fQZN+LsDIgvgaCyohVc33s0TJ8PGWQ4fW92xfbBs5vfBefXuPk8 3VbR5sDcm8PQvE9DMBqMOhvGHXlVAU192Fh2hsD8iBy778PbOUQUC+9noLrK9ojO4COW noYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=pYJbJmPU6BIEnJefBFh5xRcoJFrJ2M5xfAgdbXU36Ac=; b=uDD6rk7dQr4CbXiTDXL/JxI5Jh35h2OexTx9+E9v9OsYM2TqI5rugLhtFmCUTeNoPd eMO3zTWkVokbTecOG0kY3CoWV+Inb49N6U9WGr8dwgmVJZWPWubKHmIhzJTmGEF5Ekhl yi54QFzZ4LQLs6M/jO0mzsYeQNeTjXBPWGmnyGowXuMSVhbtz3VNzbRpEVuT/aqmYX8W oCVlhbUPTBtkxpMnXWesgE4b90/h25sug4v0H6IabbDxfWc0437ZpIbRpv6pN8Q0guke nuTMVH+EvyCDS4qt0/GCnXfagGs9yATkpBkidcToPAIW6FxtfHhvJ3lC3TZ9sjndZs/7 bG5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fXRg08pT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si6606177plo.210.2018.11.03.06.07.53; Sat, 03 Nov 2018 06:08:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fXRg08pT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728596AbeKCWSn (ORCPT + 99 others); Sat, 3 Nov 2018 18:18:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:45616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727957AbeKCWSn (ORCPT ); Sat, 3 Nov 2018 18:18:43 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 0737A2082E; Sat, 3 Nov 2018 13:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541250446; bh=1DU/jIIVKUlpBUinxgKHrp5ClNGwMy3guBmpWLDUbmU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fXRg08pTBqgCMuG1pjnPQKLLvqzil+xjmdXxdCH/7lR1qA4cXFa7oy0v1KSl8FsUt j0Nr/TQJKx9iGdK5rpsJDxFslDi6ocOCn6XmAaP5JMCSckE/+zNPBhXYEsMcbzJXAE Jiimpk90joy6575aPUQkxi+VNEweqljXwy7WlBnY= Date: Sat, 3 Nov 2018 13:07:21 +0000 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "lars@metafoo.de" , "knaack.h@gmx.de" , "Hennerich, Michael" , "renatogeh@gmail.com" , "giuliano.belinassi@usp.br" , "pmeerw@pmeerw.net" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , "devel@driverdev.osuosl.org" , "kernel-usp@googlegroups.com" Subject: Re: [PATCH v3 1/3] staging: iio: ad7780: fix offset read value Message-ID: <20181103130721.53a806a5@archlinux> In-Reply-To: <17254fcab5fb927e31ba6eac2194b0aeb9456cf0.camel@analog.com> References: <2191be4d531651db39682178ec0660eeb5697439.1541082656.git.renatogeh@gmail.com> <17254fcab5fb927e31ba6eac2194b0aeb9456cf0.camel@analog.com> X-Mailer: Claws Mail 3.17.1 (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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Nov 2018 15:02:32 +0000 "Ardelean, Alexandru" wrote: > Good catch. > > Acked-by: Alexandru Ardelean On the basis this has been broken for a long time, and you are clearly doing other nearby not fix work, I'm going to take this through the togreg tree rather than via the quicker fix path. It makes my life easier :) Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > On Thu, 2018-11-01 at 11:43 -0300, Renato Lui Geh wrote: > > Variable val subtracted an uninitialized value on IIO_CHAN_INFO_OFFSET. > > This was fixed by assigning the correct value instead. > > > > Signed-off-by: Renato Lui Geh > > --- > > drivers/staging/iio/adc/ad7780.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/iio/adc/ad7780.c > > b/drivers/staging/iio/adc/ad7780.c > > index b67412db0318..91e016d534ed 100644 > > --- a/drivers/staging/iio/adc/ad7780.c > > +++ b/drivers/staging/iio/adc/ad7780.c > > @@ -96,7 +96,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev, > > *val2 = chan->scan_type.realbits - 1; > > return IIO_VAL_FRACTIONAL_LOG2; > > case IIO_CHAN_INFO_OFFSET: > > - *val -= (1 << (chan->scan_type.realbits - 1)); > > + *val = -(1 << (chan->scan_type.realbits - 1)); > > return IIO_VAL_INT; > > } > >