Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5250737ybe; Tue, 10 Sep 2019 00:22:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzd0CAbVeBrh18yRm7+zaIidehsGLQH1HnMzdS3A+80fSNAeylYbWFJ8mEK9LYvCVXFroDh X-Received: by 2002:aa7:c80e:: with SMTP id a14mr10870805edt.205.1568100164034; Tue, 10 Sep 2019 00:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568100164; cv=none; d=google.com; s=arc-20160816; b=uM18ofeZ9x6/ErJAzm8wk+Uy5Ffx+2x0fsOuVtd63TwEldEHRyIWHiaDDf5UvspaPh RrYYs5VDPyd6DS+zslQnuT7L7owieavGSOZQhZ7rLRZRiK/PVvphVaUEMaGGpqDCqWiF HyqS0q87km+I3MfnNywAZAuBJk9PySzyO7+Pb+W0RtksFd4B6Td5pCAyT+UwPHpruQsX M5uRxVh/6nKapqXU87rYoPpkQyAdN7IfZD3iDYsVOOXoLCDTzRLQ+SddLmHD2AiEnD6b QoAmhNXOSnIlESDMPwROjnGdo2+gSvR15zVrp2efuItw9nrGg7Pn75OyI6jAsCbmgnLl gIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=V12r2Ev01WShRsJfEFUhswmwT1v7gcVL/igikBfE+Ic=; b=B5n5+GjWWexuiraIsQPRJHlIMW7jlzOV2FF3f9SFjN4VvxGAXt53rjnGte588jSFGd FCfj3EafWELOeOdI7ay6/yeYy4NKh5Zi9YfTj5ZZpMs42AaaExn993mf9EMCbH62r1eN sVLiTBcJbZDIo9EU2mu7qQLFlNlLeDbaDo7VK1sggWVnbbnu6oazbR/PADkKc8DAG+Uz J3/Go5wAyQWYGK8y+edl1jUXodMZOtZUUgmxx/0YsBQJIzEShpuqZ9AdWnrCL6YTOkGn gGcUGHdxCYWZvJP2PGLiKFj7YE1xaAVtF1x/+axNM+D8DTTUZt5YbbF6RodOJl+vQBSH +vEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v39si10882576edc.234.2019.09.10.00.22.20; Tue, 10 Sep 2019 00:22:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404642AbfIIMic (ORCPT + 99 others); Mon, 9 Sep 2019 08:38:32 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:45625 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbfIIMib (ORCPT ); Mon, 9 Sep 2019 08:38:31 -0400 Received: from localhost ([46.78.15.232]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MsqMq-1iRBEX2R1k-00tA70; Mon, 09 Sep 2019 14:38:09 +0200 Date: Mon, 9 Sep 2019 14:38:08 +0200 From: Andreas Klinger To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] iio: adc: hx711: remove unnecessary returns Message-ID: <20190909123806.ewrxc7y5gmh5plmk@arbad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K1:sYDxRPyTH6C963S9/gA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JLhgO+d8 4RI6bWnX0LYYSWPrTosoAxaS4yxLQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Optimize use of return in hx711_set_gain_for_channel(). Signed-off-by: Andreas Klinger --- drivers/iio/adc/hx711.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index c8686558429b..20c249f502c0 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -213,7 +213,7 @@ static int hx711_reset(struct hx711_data *hx711_data) static int hx711_set_gain_for_channel(struct hx711_data *hx711_data, int chan) { - int ret; + int ret = 0; if (chan == 0) { if (hx711_data->gain_set == 32) { @@ -224,8 +224,6 @@ static int hx711_set_gain_for_channel(struct hx711_data *hx711_data, int chan) return ret; ret = hx711_wait_for_ready(hx711_data); - if (ret) - return ret; } } else { if (hx711_data->gain_set != 32) { @@ -236,12 +234,10 @@ static int hx711_set_gain_for_channel(struct hx711_data *hx711_data, int chan) return ret; ret = hx711_wait_for_ready(hx711_data); - if (ret) - return ret; } } - return 0; + return ret; } static int hx711_reset_read(struct hx711_data *hx711_data, int chan) -- 2.11.0