Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3402109ybt; Tue, 23 Jun 2020 01:07:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgiKtmQfaSZUMqb+f9VtPheba+NTWJ0VerF6AfkXqI0SHB6+0PK9KMVT9slIRdys/YOMq6 X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr5238036eds.236.1592899642922; Tue, 23 Jun 2020 01:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592899642; cv=none; d=google.com; s=arc-20160816; b=VNQeyvj4kiypV/DfOhGQUFBdmDFkcAAEMJGsI8ydwddvX3qUeeai7BOT6a0nIwpOB4 g44iv8q1QJIw4OS1Njy1fUt7EsrRCYHX/Kye2bA2hpHKFPDko9JqZX3nmbn2vaAQnD2A Tw/O5+rNEdrOYML24foQU4O1NxMMvVOWuU0j6cMlT6CK/Mdq8Av6NvXD3qfSbU9qD14P uPQoQaaZOzZA0WSUe+JEJNT1j6xKU20UqhHk2ZrP/Lw2Bo+rMJybZGmYyDVBFISGjvrE 0qyweibbiDRCjPezDUe0h0GIKw5DgZ3cA8LzJQmm14JBaW+kURedukAHzal10cepY07S x1/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gQQ6b8/L+9sBz/aiKlXca9tRv5gX+sjabdZJB9mU9RE=; b=nLRVFuNxyBdmidgfX+X/2XQYc/QdhGorD71xaj9BphtUNJZxYPEeaxuu/VQeFpQRht cSJm8uNxnRT8wKPliVCI5e7djPMyUSz26+8E9CVbQ0SDsBiMH6OOVHmw9ODCgcC59VuG /k8e3U4VOTbqUHaz/oBtMEp0xrFmJhb9k1n7VqN/5GSB1imKX+yUQNtqvMT6x16UZMn3 U2fN8CwpVTjMH5tsutPS7UztNMFgZLqNl5gUc9sKDKXz9QxsAXq512SbwqvQ+8mBJMgN 8KoYjCuBjSmTgD5vAXV4FWCLJPTrQyx27s8Xv/xJIqBjw75XrjA5EMAe5Nb+u9mcwie5 X/Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="alyRb/xu"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si10433657ejn.715.2020.06.23.01.07.00; Tue, 23 Jun 2020 01:07:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="alyRb/xu"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731653AbgFWIEM (ORCPT + 99 others); Tue, 23 Jun 2020 04:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731516AbgFWIEM (ORCPT ); Tue, 23 Jun 2020 04:04:12 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2321FC061573; Tue, 23 Jun 2020 01:04:12 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id d10so6892294pls.5; Tue, 23 Jun 2020 01:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gQQ6b8/L+9sBz/aiKlXca9tRv5gX+sjabdZJB9mU9RE=; b=alyRb/xuu63Uprh7RDa9xQ4rmpLhmeZbNXp0OLqJlJ2k/omRlsKHSrPar0/n6J0iil l16u+1Rlo77I1yBuOqTMhjrG1uYoIzzpFFhUVw8xHlLa2yfVOC56onewRfXob4Qfh+rI jQLz9Zv71H5G5Y+s3tAfQU6Sp6Op2K0CgjbOcG/JD3Y03PZSJZiCNuclmuUgyMqJ2Vcp Qv4nYIi5f0RUF4ShwGHnF3bCyVryU6vEMIztg1mo3Je/+GYsK2GZYL1UBekpLWPD3YuN 7Hg2GijtFcUaixhesxGUIOpEL6V13+ckVR/2SC0WK9RGZwqAoWZPrHxFzjVIthuJC90z WQJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gQQ6b8/L+9sBz/aiKlXca9tRv5gX+sjabdZJB9mU9RE=; b=ps6pVC2yU707bQWi3U1FMNqjgKeZ11a5MJCL3OW6srn6n+FqvxiBveEAgtQbfgcrF/ LI5DY20gCvu4/ejMod7aBdqmfNDxyD5WD4GOVuotfzaI/p/OEvNqwXvfByKwLBL7Rw3C FEdmpkmqTAhPz3P9TR6nsAmhTkXsF3KRp1wyGJrq//xVK9uHNXZEvLa7Mejm23jIoDWw oKAuaTotW2bSPIH0eOzB8oKQppfdnCw6Gq0PyBZOCoIAlVZThiRbvMbJY3cqFK9qc0Ts 4pAydCYMbRbTr7Em0ljYnl5TImzNKHo06Qn1xWi6OcVrgvaKHvjKsvGBoYt4nbdZyYP8 OkUw== X-Gm-Message-State: AOAM533tWk2dw0Xw/sqpRizec+GUCmKpbo/Supl5cUzo2fQInM3bPUVf OrpheTgk3z9eNNv9dz29pQtjzvdIJrT19awyQmw= X-Received: by 2002:a17:90a:b30d:: with SMTP id d13mr21917940pjr.181.1592899451496; Tue, 23 Jun 2020 01:04:11 -0700 (PDT) MIME-Version: 1.0 References: <1592897399-24089-1-git-send-email-jprakash@codeaurora.org> <1592897399-24089-6-git-send-email-jprakash@codeaurora.org> In-Reply-To: <1592897399-24089-6-git-send-email-jprakash@codeaurora.org> From: Andy Shevchenko Date: Tue, 23 Jun 2020 11:03:58 +0300 Message-ID: Subject: Re: [PATCH V7 5/7] iio: adc: Update return value checks To: Jishnu Prakash Cc: agross@kernel.org, Bjorn Andersson , devicetree , Linux Kernel Mailing List , Matthias Kaehlcke , Linus Walleij , Jonathan Cameron , Amit Kucheria , smohanad@codeaurora.org, kgunda@codeaurora.org, aghayal@codeaurora.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-iio , linux-arm-msm-owner@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 23, 2020 at 10:31 AM Jishnu Prakash wrote: > > Clean up some return value checks to make code more compact. > FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: Jishnu Prakash > --- > drivers/iio/adc/qcom-spmi-adc5.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c > index dcc7599..3022313 100644 > --- a/drivers/iio/adc/qcom-spmi-adc5.c > +++ b/drivers/iio/adc/qcom-spmi-adc5.c > @@ -301,7 +301,7 @@ static int adc5_configure(struct adc5_chip *adc, > > /* Read registers 0x42 through 0x46 */ > ret = adc5_read(adc, ADC5_USR_DIG_PARAM, buf, sizeof(buf)); > - if (ret < 0) > + if (ret) > return ret; > > /* Digital param selection */ > @@ -388,7 +388,7 @@ static int adc5_do_conversion(struct adc5_chip *adc, > > if (adc->poll_eoc) { > ret = adc5_poll_wait_eoc(adc); > - if (ret < 0) { > + if (ret) { > pr_err("EOC bit not set\n"); > goto unlock; > } > @@ -398,7 +398,7 @@ static int adc5_do_conversion(struct adc5_chip *adc, > if (!ret) { > pr_debug("Did not get completion timeout.\n"); > ret = adc5_poll_wait_eoc(adc); > - if (ret < 0) { > + if (ret) { > pr_err("EOC bit not set\n"); > goto unlock; > } > @@ -516,8 +516,6 @@ static int adc5_read_raw(struct iio_dev *indio_dev, > default: > return -EINVAL; > } > - > - return 0; > } > > static int adc7_read_raw(struct iio_dev *indio_dev, > @@ -761,7 +759,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc, > > ret = adc5_read(adc, ADC5_USR_REVISION1, dig_version, > sizeof(dig_version)); > - if (ret < 0) { > + if (ret) { > dev_err(dev, "Invalid dig version read %d\n", ret); > return ret; > } > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > -- With Best Regards, Andy Shevchenko