Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55D58C433EF for ; Wed, 5 Jan 2022 19:34:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243581AbiAETey (ORCPT ); Wed, 5 Jan 2022 14:34:54 -0500 Received: from mail.hugovil.com ([162.243.120.170]:38876 "EHLO mail.hugovil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiAETex (ORCPT ); Wed, 5 Jan 2022 14:34:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=f+UuEnMxTVqpzxOb1LP/W65bh42k1E6+C/VjtXgdTb4=; b=g LxFSZAbAXh4UjCu1ynYXRRD356LT1OfPMbTt2gZsrw1m/gS6M3wJwj/IGP9pVOOLKZtRed0B8He+1 KowIYj2z/h4kJHLrxIMt2pvqjSZ7DsE/3mx4eCi8Cpjv5VtS18Gv+gIAuEpXUL7KPWX+RiFnOobjv w69mjzAN2A6p40tQ=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53874 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1n5C3c-0001ym-Mm; Wed, 05 Jan 2022 14:34:49 -0500 From: Hugo Villeneuve To: Alessandro Zummo , Alexandre Belloni Cc: Hugo Villeneuve , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 5 Jan 2022 14:34:39 -0500 Message-Id: <20220105193440.151359-1-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH] rtc: isl1208: avoid unnecessary rc variable tests X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugo Villeneuve The rc variable doesn't need to be tested a second time when the block evaluates to false. Signed-off-by: Hugo Villeneuve --- drivers/rtc/rtc-isl1208.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index 182dfa605515..c7f04df5a0b6 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -880,15 +880,17 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) if (rc) return rc; - if (client->irq > 0) + if (client->irq > 0) { rc = isl1208_setup_irq(client, client->irq); - if (rc) - return rc; + if (rc) + return rc; + } - if (evdet_irq > 0 && evdet_irq != client->irq) + if (evdet_irq > 0 && evdet_irq != client->irq) { rc = isl1208_setup_irq(client, evdet_irq); - if (rc) - return rc; + if (rc) + return rc; + } rc = devm_rtc_nvmem_register(isl1208->rtc, &isl1208->nvmem_config); if (rc) -- 2.30.2