Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp63112ima; Thu, 25 Oct 2018 15:31:50 -0700 (PDT) X-Google-Smtp-Source: AJdET5d2gh3jNS5StT75/PWV2XzVNkUufFNagNb467J++9YFFwZglGkBWKhyz+j8z27hdRLYPBzo X-Received: by 2002:a17:902:be11:: with SMTP id r17-v6mr944319pls.95.1540506710285; Thu, 25 Oct 2018 15:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540506710; cv=none; d=google.com; s=arc-20160816; b=FN76yp4w2sn0r0GeHCFKHsKgusR68QcATAgZVRmdlmeTvxHpf/+vdkcz9m8+NI7j37 Z7ThuCL/trmWk+0jV4zf1BH+IB7yyghzlobOVtmZirM68sRNLpS72M4EGD1VPQyyf/3W 6oB/GipL4X8kqUwSFLYM3yW8vFEej0roMsLHYRvtGkUPV2ZNb0/1/YivCTH3qT/m7Emm DobaZwrDbxb3+LMF0J0cj6vmWmIrmhef//u6Gc6wUkKrzvKzVo0l5A1jUL8z09oAsfSQ zD3uXS5OGEtav82eYHO/jsGJtbxRyDyq1EtiJHWy+AM+nwf5ze2slrJdM3KZhNryXVJX 4Z2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GOH5FTRIP3FPe1Cf6mg0NjeaY1IjAp+qJmnzPVmJk30=; b=0gTeb+0Tbzq3b+yO4mVkfpmYmlxKzpiUP10K68zTnbo0Qf1Sgc7JbTMFCzEpmeVBuL rVJAi1Sa7oEfGB92npffgM//n1F3X1Vx81t8uQgQpFOFqAgU8qJiBeCciUCgDh4f8VHD hnw4Fwb/MP+a+jpsTgbZBTASP7LkHA96zZ//W7q0j5lElS/WuDmCTdC11yE1cn5Us0My mKEFe574d8yj6LSilCxiDAj0z8SPsYaSxbiH/9/IijA0iMczI1+sqaTfL/AHFw+3Po47 +wME9RvK0ijfA6Gm5Bo6k95bYYM5PMuAnJbLdtc9VqVfLondtT6p1/bFwIPbSxjI+uiy Izzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eYHc4jdt; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10-v6si8511328plr.299.2018.10.25.15.31.33; Thu, 25 Oct 2018 15:31:50 -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=@gmail.com header.s=20161025 header.b=eYHc4jdt; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbeJZHFM (ORCPT + 99 others); Fri, 26 Oct 2018 03:05:12 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39160 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbeJZHFM (ORCPT ); Fri, 26 Oct 2018 03:05:12 -0400 Received: by mail-qt1-f196.google.com with SMTP id g10-v6so11893343qtq.6; Thu, 25 Oct 2018 15:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GOH5FTRIP3FPe1Cf6mg0NjeaY1IjAp+qJmnzPVmJk30=; b=eYHc4jdtnwIaRYvfosi6txc39FCOSMUozoqneiD7TExsXsjp2Jxu7kgU3eo7K+czDg GLNjpEnhfuU/KgoSFcnI4nTEOAq8hVHcwApVS+LQm95c3AoUXVIlMY5tbBCE+iRS9iv3 mhOEKKDUK1xTqxBw9mb1sBys+sSOeZLQ3wMJCpfDiJdnzlM82dXYDNlgkE7JuRfwhtPw 3Og65Tm7lubSvTp5a6xrKOmAygp82DdTh7gNoO0MJW++9JkgbvoWO9VPu86IwiovOJd8 6bTzb33AJXTaXbCfvU5RgfljJvB+SUICspripBI5r2YRT4HXXt8KYSo9q2pTvtcyklmM +6SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GOH5FTRIP3FPe1Cf6mg0NjeaY1IjAp+qJmnzPVmJk30=; b=IChF+96d5Ym7UjLoJKgLfhQzaO+w4C2lv6Pbrjl9pZ1NkSAKbgKTKwJBUnKW8rQ8PC bF8u/lLyWd6ibBi5S1AFIwhvlEgQkY30fGRu2KOtPbP+Hw+ZO8JDB6aby3RZiHSsYyl7 iasypbSG0egcImUr0RjY7JFq/gmlYL4FFgS4/UiY22b34CcLtEHOhbUcY1MFENLc2YuT RxFVdIcNR9NjUNx2SWIz6ZmBD3sBna6IdH6q3GiL9gtLuwYijhX6ITBa1mRzxWxTQwhP it6PgU91TZsuWSKtowlD5B9hyQM88uWp3pfX57Qn5zgDdOpKVKWnmx4iJpakem6LuSIk gmLw== X-Gm-Message-State: AGRZ1gLdxj2IWjRVBrFo4zxEjsPuPEOgZEAkJNm4hEfplRvWisUDG92z aZ0j/3cCsPS36iCWhdTp2Lo= X-Received: by 2002:a0c:f047:: with SMTP id b7mr1037530qvl.236.1540506642441; Thu, 25 Oct 2018 15:30:42 -0700 (PDT) Received: from renatolg ([186.220.20.163]) by smtp.gmail.com with ESMTPSA id n47-v6sm8983755qtc.29.2018.10.25.15.30.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Oct 2018 15:30:42 -0700 (PDT) Date: Thu, 25 Oct 2018 19:30:37 -0300 From: Renato Lui Geh To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, alexandru.Ardelean@analog.com, stefan.popa@analog.com, giuliano.belinassi@usp.br Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH v2 2/2] staging: iio: ad7780: fix offset read value Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 27972563bb6a..06700fe554a2 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -100,7 +100,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; } -- 2.19.1