From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87C69C433F5 for ; Sun, 15 May 2022 09:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ez4GGqlZ7CdsUUrXU7FEZJ5V6PGzxz4Vb1HLnnMqtQ0=; b=3jj2lEgtuqQ0tw Ztj6lI/c6y9ODO2B+CmiMmb9/h/4yyhzkyy8X7P74U8JVqwYnmmN3+ipvJEUD9LnDQu4PM8tWp1F1 3Yjx097RrDC77DZeeps+LpLJ7wA7tNnFXILhVbsTwii4kXfsqKFmX1Q97yZIqIeUoFxixhlS7GaHA U2wJBuyvOqMi+waSQ2Fzp9dcnUalLndh8FsSyrpZEochxbiWB7XT+Ceq00g2nE2+o7DQBigU4iPzM Iq066X4OL4ADFJHusCpwRXYFlJh3h/OSfGM0pT1ArGu/mD5MA5mNAQQP/qkHCkRobacRVGw0MF3WI J8ixXp7/EztoxV9eS/Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqAmY-003c4C-Lm; Sun, 15 May 2022 09:43:22 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqAmV-003c2u-LB for linux-arm-kernel@lists.infradead.org; Sun, 15 May 2022 09:43:21 +0000 Received: by mail-lj1-x231.google.com with SMTP id t25so14963192ljd.6 for ; Sun, 15 May 2022 02:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=Pt6G3dPF8Zt8XeHJg2gaFEt91Dc0HgS53/V5velP1Sk=; b=ITlVUPlGfZyv+7a/EilVFVl1Gk1mFMaY2yhXbyWEGMyQip5275wed4ULnbdh0766mQ U3AB/Q1NKj/kGshg3RdXPoec0Hihn/G/+K8vE14Yf5VmhmpkRgvkuvR6Yq5N7Vrc69TE q2eLiI8XtdoynDJGe0jnomFiwA/zNa6rJTUoMHqWSbUGlID6Ve2pPuWcYhY3F4K9YmeO mK0/6XhFd7UMBW3MnjhEr7wWy2h6zWW0HlZkNpwqu8g0QXKEcRAPPAd75Qjc0dAZ4Opi GG1tNEH3K+OC2P9d/noga7m6PLdhGOlVnoz3W+pKUxjqrABmYTsiZFNFR1EQXxM5H5tQ lw7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Pt6G3dPF8Zt8XeHJg2gaFEt91Dc0HgS53/V5velP1Sk=; b=HiD8TzZvtsgn4etUfpgf0STWw0b+d8MYyQodMF1zLtTmxCeIW+xjnq7YqRawTROHbO xnLeT+SrBW1hEMNauSvyFIwc7y0tPTIeAqRYBn4jzJ0WsYggNZND1WcfoQTQj6AxU/yw sGwv6UuXYDWV4Ie5s6VHZUA5mKguFZZ83n1EuXYcu1qm78olLyeJzAuWJUtQhLKr23Dt cEkofW2wmhqbnrqoZCMjfFdiH/6X7eo74/uSvf93RznoNk2BqLMEPe0H6mH6X6o0+h6T /4caATbtq8jaWOGDqwXh27KoO81m6tRjRpij+8B7I785kmRQeIHt9SLT/STjbTK35EFA mm4A== X-Gm-Message-State: AOAM531O3+IJXB+AO2AmcWdZiXPY0msjpOJSoSfbTKODhaThpcp9fp8t jnDDK279VUtSgpwHD+r1rymKSg== X-Google-Smtp-Source: ABdhPJwA2OhaOBCwKTPixvleagueOpD+Za/kYH7EQQd3X2W4nG6luGi2OVIczI+WHbzlEGeGmCFpXw== X-Received: by 2002:a05:651c:1684:b0:250:c5ec:bc32 with SMTP id bd4-20020a05651c168400b00250c5ecbc32mr8133343ljb.92.1652607797625; Sun, 15 May 2022 02:43:17 -0700 (PDT) Received: from [192.168.0.17] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id k15-20020a2eb74f000000b0024f3d1daee3sm1099269ljo.107.2022.05.15.02.43.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 May 2022 02:43:17 -0700 (PDT) Message-ID: <7c479bdb-4bf7-68a5-c6e7-20dc19b91dc8@linaro.org> Date: Sun, 15 May 2022 11:43:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCHv2 3/6] thermal: exynos: Check before clk_disable_unprepare() not needed Content-Language: en-US To: Anand Moon , Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220515064126.1424-1-linux.amoon@gmail.com> <20220515064126.1424-4-linux.amoon@gmail.com> From: Krzysztof Kozlowski In-Reply-To: <20220515064126.1424-4-linux.amoon@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220515_024319_780417_4A984572 X-CRM114-Status: GOOD ( 18.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/05/2022 08:41, Anand Moon wrote: > All code in clk_disable_unprepare() already checks the clk ptr using > IS_ERR_OR_NULL so there is no need to check it again before calling it. > A lot of other drivers already rely on this behaviour, so it's safe > to do so here. > > Cc: Bartlomiej Zolnierkiewicz > Signed-off-by: Anand Moon > --- > v1: improve the commit message > --- > drivers/thermal/samsung/exynos_tmu.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > index 1ef90dc52c08..58ff1b577c47 100644 > --- a/drivers/thermal/samsung/exynos_tmu.c > +++ b/drivers/thermal/samsung/exynos_tmu.c > @@ -289,8 +289,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) > > mutex_lock(&data->lock); > clk_enable(data->clk); > - if (!IS_ERR(data->clk_sec)) > - clk_enable(data->clk_sec); > + clk_enable(data->clk_sec); You say that clk_enable() checks for IS_ERR_OR_NULL. Where? I see only check for non-null case and then immediately taking clk prepare lock. This looks buggy... did you test it? Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel