Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9947103pxu; Tue, 29 Dec 2020 09:15:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJybcItm7b43ZJg/ynee+yNTeW8pJhy704a4AMAa2K3ksF7dtjlmkT4NmmKOLJtzbqOdsx0Z X-Received: by 2002:aa7:c753:: with SMTP id c19mr47252357eds.358.1609262105232; Tue, 29 Dec 2020 09:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609262105; cv=none; d=google.com; s=arc-20160816; b=gZniyRbdxqT/v4dm3lMhvwDDFDR7pSMNQ3PGC0AdMt2LI4BUbb2xc2+EoSJArfux9Y u0ao3s6zijKbuO0abwAtwNvfJ3uDrCoYqC28LhZvZnjBUZI696FAzgoFts18hwf51plE cPgCYK6uVmueUEyQ3L/iWz88hJluciVsTxo3xQsgObMEgKYkRGEYwYrABTbb4BEFjnkA 2dJ/UKOw7/V2o2+qxIbFnMx+sO0V4UAennNtnbBbA4PH8FbDR0O8EqE2URnjJvefjJUG BUxX7Fer+0zWR+ktDgAanltW/pfggOnRskShXtUjjkzKhI8eOemPS3k5ceKr5mSgrXXj PltA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=boI9TTFH6ABF2nTnmPtpmiB54oywxXJOltn/unZtn7o=; b=VeVfA2jke1Jw2lp8o9h3SwU/K34EtG5JyUJ+aZMLM57KHeLW84PG3w+UtJgv/RQGwS oW0Uafa6TEDBvkxFqB9CeSpcVvNzrvIqIg7BvmR8QSuHiSnzFKObzxo10Vo8H9zNUydv Vfi3y2NaiXDRLIlJS398js1uw84akwtCba+Z+YzWwAyWGQtwhtsD7J83td3MzX4hoeI9 h+MCwFWgEtBovDu0vo/pDYQNNqTSuwXREjnCQDvshUKkagr1RsjuCOjcN0vh8LdPOjhH BxEpn/tVzkOOgJsLqQciH8S+1FB71L7UIPeT9Dem5P4Rsg7aMd8tByB1xRTgKNiW8wzF gdVw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si19982415eji.498.2020.12.29.09.14.42; Tue, 29 Dec 2020 09:15:05 -0800 (PST) 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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726198AbgL2RON (ORCPT + 99 others); Tue, 29 Dec 2020 12:14:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:43950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbgL2RON (ORCPT ); Tue, 29 Dec 2020 12:14:13 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 801AE21D94; Tue, 29 Dec 2020 17:13:31 +0000 (UTC) Date: Tue, 29 Dec 2020 17:13:28 +0000 From: Jonathan Cameron To: Xu Wang Cc: lars@metafoo.de, Michael.Hennerich@analog.com, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: frequency: adf4350: Remove redundant null check before clk_disable_unprepare Message-ID: <20201229171328.7f0e298d@archlinux> In-Reply-To: <20201218094647.1386-1-vulab@iscas.ac.cn> References: <20201218094647.1386-1-vulab@iscas.ac.cn> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Dec 2020 09:46:47 +0000 Xu Wang wrote: > Because clk_disable_unprepare() already checked NULL clock parameter, > so the additional check is unnecessary, just remove it. > > Signed-off-by: Xu Wang Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to see if they can find anything we missed. Thanks, Jonathan > --- > drivers/iio/frequency/adf4350.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c > index 82c050a3899d..1462a6a5bc6d 100644 > --- a/drivers/iio/frequency/adf4350.c > +++ b/drivers/iio/frequency/adf4350.c > @@ -582,8 +582,7 @@ static int adf4350_probe(struct spi_device *spi) > if (!IS_ERR(st->reg)) > regulator_disable(st->reg); > error_disable_clk: > - if (clk) > - clk_disable_unprepare(clk); > + clk_disable_unprepare(clk); > > return ret; > } > @@ -599,8 +598,7 @@ static int adf4350_remove(struct spi_device *spi) > > iio_device_unregister(indio_dev); > > - if (st->clk) > - clk_disable_unprepare(st->clk); > + clk_disable_unprepare(st->clk); > > if (!IS_ERR(reg)) > regulator_disable(reg);