Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9990485imu; Wed, 5 Dec 2018 14:01:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/XzyasVgkYewDQaZmD0u805FRCPuH1iQIFNIm8NmpuKsObshdXFZ+4Q+c1N7OSXS0tLqzeD X-Received: by 2002:a62:f54f:: with SMTP id n76mr26073390pfh.59.1544047272615; Wed, 05 Dec 2018 14:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544047272; cv=none; d=google.com; s=arc-20160816; b=qdzsqC0lAGiiN58QVG/Gndw4LJz1k3URyN+pilb+giZaqbAYL48u6fbKUu3krK4T/p N+RsnSB104/vP5J6RlJZQKabD9uH4SZ8L8lx2KeTsI1fG4iw9oDpFZiAkZtxkaV5ZaLL Zw6I0iJmjTGcq/TAbieao/9LzNcwP+oJ59KiA5W1ZcHdV5b86RDqO2X2nazRpHud+xsC NEm3ybltX81Rg82WMk5KkKkci7gys/dwijgwUvw6FQAWQ6RxDTf8Zf65AKszpo03jz+K TrbbEzAeEwBPDhiY7ZgcUFS+GKwGINabvkx4jiz/iiS5+DJO5vsx0pioO4Vd6ST5ENYb x+sQ== 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=PR2WoUOlxh2V5Fh31suImsfSZjtFe0LlLK2xk4cpACA=; b=my3DGOAII5s6DMyCeYRuED9VTRvyHCxQAQl90ZrWz3FMnqfA69FeNoaniRuMGo38KX b8v9gsTKUy3qc2iLLgeNiv35cQsBFFBzy3UabuvD/Ffep8cXD2F9Rm9l0E5nnqfv98+j Kt8GxfR/q7DFFEg0AKykUgpc3MdCTog/v3AtrUtdYbqj986Ob9s7OTpuyqp9jBG2i2+c htOEWy1MOYZEB/l54jOTiVhOdA0p6ZnK4ILyyL1ZQXfG7J5i8AoTqGEEiuyjx6re6h+o OqdPwQoUwGDfRrMfHSUeo4s/JIjZzWzQGEsrBYbfTZk4wxya4s7jBz+5Qx7DgKwsXzai ig2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rVLj/rSL"; 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 u22si17776172pgh.286.2018.12.05.14.00.57; Wed, 05 Dec 2018 14:01:12 -0800 (PST) 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="rVLj/rSL"; 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 S1728670AbeLEWAE (ORCPT + 99 others); Wed, 5 Dec 2018 17:00:04 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:44696 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728038AbeLEWAB (ORCPT ); Wed, 5 Dec 2018 17:00:01 -0500 Received: by mail-io1-f66.google.com with SMTP id r200so17978499iod.11; Wed, 05 Dec 2018 14:00:01 -0800 (PST) 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=PR2WoUOlxh2V5Fh31suImsfSZjtFe0LlLK2xk4cpACA=; b=rVLj/rSLnVWKduALodCcgmPeNDFH3w86bSm6TOjeUtzdOqY/ZarolqIQ68+Isl3Rkw KDbA7nCcfLN1pXYhed0bhij8yv4oockcwG++P15tdkLQowNIquu0co8vj3pRzII1+pfD +x0HpTYeToTFyS2i/2s8Kb2eG0xWN4gZBIxRdhTelVpubl4RXNxzEAp44H+lZS5JjriB PZX5kKRNFkY85FZMDRViJMxa72j/DuVK2OQMLU4X3fCL3r9YBCN3S8xkIrxPbOhRIEGW a3KdiY748KUG7VhghPrMtKbPM2zdHgEo8gD+A8PVerOu0hahDBEizt2ghwLsO1mkx10f YPdQ== 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=PR2WoUOlxh2V5Fh31suImsfSZjtFe0LlLK2xk4cpACA=; b=Xh2d2J4UWK+QsV4TOQnjJK6iH2nyHqC+a3zkiwNYW3rzowQauDNbk89atTSbmMbZdh YSjGE0O4rozIP81CG+TagreOQd/ptxW2wH+4/YThdN2rlQGv+JPowXx6YYANBfhEcXcY bBJIY1LSFqYPbjK9v1wd1hNG2+gNNLPsx8R9mjjXbmxk3/eY6L3D8NgU3E7w+gbvQqUa N1bMPzfx2s/9Udsd49V16QRc67DQZr3ex6UfxIxNYx5rGdxzZ/EMyFhMtuvabkdwvfe7 5b4JnOH9QlzqPbmkbqrk+ItdSYXfp+INYL5RdZEvzkDmS9qYMEcOQHmUj25G4Xm0OMRU fBbg== X-Gm-Message-State: AA+aEWZ78M48DJSr0vhoNjyaRTF+T2EkaCS12ANDz4hz+zC86Zts4rEU ns1UU4N1fWAKwWF7SQ6hQYo= X-Received: by 2002:a6b:ab83:: with SMTP id u125mr22080520ioe.211.1544047200754; Wed, 05 Dec 2018 14:00:00 -0800 (PST) Received: from r2700x.localdomain (c-75-70-96-103.hsd1.co.comcast.net. [75.70.96.103]) by smtp.gmail.com with ESMTPSA id x17sm8548303ioa.6.2018.12.05.13.59.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 14:00:00 -0800 (PST) Date: Wed, 5 Dec 2018 14:59:53 -0700 From: Jeremy Fertic To: Shreeya Patel Cc: jic23@kernel.org, linux-iio@vger.kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0" Message-ID: <20181205215953.GA2365@r2700x.localdomain> References: <20181205014900.4827-1-jeremyfertic@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 06, 2018 at 01:25:55AM +0530, Shreeya Patel wrote: > On Tue, 2018-12-04 at 18:49 -0700, Jeremy Fertic wrote: > > This reverts commit 00426e99789357dbff7e719a092ce36a3ce49d94. > > > > i2c_smbus_read_byte() returns 0 when a byte with the value 0 is read > > from > > the device. This is a valid read so revert the check for 0. > > > > Signed-off-by: Jeremy Fertic > > --- > > Hi Jeremy, > > As per my understanding, 0 value indicates no error but no data read. > Then how can this be a valid case? > > Can you please make me understand that how can we consider this as a > valid case even when no data has been read? > > > Thanks I'm not sure I understand why the value 0 would indicate no data read. Doesn't that just mean a byte was read with the value 0. For instance, if the input to the adc is 0V. Can you point me to where you're seeing that this would indicate no data read? > > > drivers/staging/iio/addac/adt7316-i2c.c | 4 ---- > > 1 file changed, 4 deletions(-) > > > > diff --git a/drivers/staging/iio/addac/adt7316-i2c.c > > b/drivers/staging/iio/addac/adt7316-i2c.c > > index ac91163656b5..2d51bd425662 100644 > > --- a/drivers/staging/iio/addac/adt7316-i2c.c > > +++ b/drivers/staging/iio/addac/adt7316-i2c.c > > @@ -30,10 +30,6 @@ static int adt7316_i2c_read(void *client, u8 reg, > > u8 *data) > > } > > > > ret = i2c_smbus_read_byte(client); > > - > > - if (!ret) > > - return -EIO; > > - > > if (ret < 0) { > > dev_err(&cl->dev, "I2C read error\n"); > > return ret;