Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4708700rwd; Tue, 30 May 2023 08:49:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7d7DFs3TTZvyZ9QogjBifVCG/orllm5x1X6fEY5b3rpSNeW3J5CKUVeGUxYwvC1T49M9un X-Received: by 2002:a17:90b:4a09:b0:24b:c580:1ab8 with SMTP id kk9-20020a17090b4a0900b0024bc5801ab8mr2820252pjb.40.1685461791324; Tue, 30 May 2023 08:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685461791; cv=none; d=google.com; s=arc-20160816; b=Ik8/Winij5kFhuIqZDzhJWyf10/Eqcuy8wCZQ+9WKLpLcTAJ/VhyVrJGK6tBtnus+s RVeQc4vlNOhXNEDM/osbxUgAhdHneBk8mctvgDvkPZKcsxE7DVw9nr3Jlhj383I4euwF /ALkKVfH0wugwDzo21snjCHu1JOL0OaM+z0BdoFUgx9PXvEbvOzP0gVchFC63vVeC2XU WuYnvQSuqYkLVD2/qXKMp8FezsXAGPyLu5//0tRTjpCkUioEueo5i4VVGgJmNKcvxc3c ZPpXcYmAPjPw9L0nQy5MqcyOhqmN0CF32v89LZjifoYqDDASQ2CB6wvQ7An6kd5/mTcK GVIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=X98uEJIUr5N96PKhi+a99X85M9f95CxufPpRR6wZq8A=; b=AzuCrXdnMrG/ZZsZ/1ZsGwACmI6Y/t0cgqXGHZreMAhYKTrKDyO0jOk0j8m5viIDn+ JxF3GiG8xUC/abfA2u9E+nHn/c22wTCSVyYn2DNr3vFgrab7z+rWn6xFSM/IKWkD81nK 9T8Dmc483IMvfsr9w+iPOo3RiiouapiQhx+FGFvq7XPjdr07ILNeix8OnFMBiAUpaxjU 2wJPMmgK3CUcR6OSbLBWhRaP2xMm4FxkLQXArgqbcu+N1w7/LK9O28xoDIZXVrG8RW7P DPw9t3A2Vemmqb9ZHiTNWw+Wr+N8NJf3qPJ424zy+VmTN/SIg+wKJD+QJChn8/i8I8bt 9GlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I4GPQWEl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gv6-20020a17090b11c600b0025327b5caefsi1599722pjb.165.2023.05.30.08.49.39; Tue, 30 May 2023 08:49:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I4GPQWEl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232321AbjE3Prp (ORCPT + 99 others); Tue, 30 May 2023 11:47:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbjE3Prj (ORCPT ); Tue, 30 May 2023 11:47:39 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86E61132 for ; Tue, 30 May 2023 08:47:15 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30ad458f085so3179302f8f.0 for ; Tue, 30 May 2023 08:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685461633; x=1688053633; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=X98uEJIUr5N96PKhi+a99X85M9f95CxufPpRR6wZq8A=; b=I4GPQWEllzF6GBOexpjF+zqBiGkBryBgzrEJtXRHQddmLLIOOng95jwaUCgCr1tgsL Jv05YlGGBLV0dnEU2jx+6DUkVpHbZZepwRBsWcxCtgO8LoZjofiJopoMWOJYUc+vHkEQ 0nkVIfh2wmrheNx40RaXua8/vNVNYV3VLClb9m6E/Ib2FLzBWX3w9HnRDP2/WMrzrS8f v4h6Xo4rA+eN7dUYhsWR5dZNWvYr3wPUYkyCzlOkIvWmVKVA7aPpl5Uo/hMqOlL9W4Vv BdMCjM0CqmsjMAMQfh3IpccWhHSKKBIVBKD0aCHhWnL/8VqQTWkP4jpb17llwILviawK Yhdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685461633; x=1688053633; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X98uEJIUr5N96PKhi+a99X85M9f95CxufPpRR6wZq8A=; b=k7k4yHXS5dFUt05zeoPCquGWXKHkICT7CswQljIUJsJoWkG1ZeWB5mSBhj2lN7/Vtc Bi3BobPxQsZCnX+e6ZK0ddzbQBdlBYUkKOSZ7yQfB4gnGuPa7OvWQ3rx1rNIpdrsEz3v LSIaDDgenzPWhN2cUIe/eHZAHkFKLbC8Gi8aHMu38NpQi7ZBOdl7zGUsbY/ZGwCSeQ/Z zL/q9GChlgh7ut1y5PiSkKq4zQ2jwxXhW2IVXXRAmNC8c71KKgSNeO89iHprvw0UAY93 5hgJwgEnwg2bSTwfIyEPZ7QsaRTltl3mdzukjIW4EzRxg4xZ4ssHGRkUyDaSxvvvJg46 BO2Q== X-Gm-Message-State: AC+VfDyn56AIfRy93Qu4CHzLEazB5FGwF3KKaRYXr7zXQ9ftOyxI19nX l4tqwZnDJyoQBKuIWWlnUCH+UQ== X-Received: by 2002:adf:f485:0:b0:30a:c681:fd2e with SMTP id l5-20020adff485000000b0030ac681fd2emr2350372wro.22.1685461633507; Tue, 30 May 2023 08:47:13 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:dd1c:e75b:56ba:6bf? ([2a05:6e02:1041:c10:dd1c:e75b:56ba:6bf]) by smtp.googlemail.com with ESMTPSA id d1-20020adfe881000000b0030631a599a0sm3735752wrm.24.2023.05.30.08.47.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 08:47:13 -0700 (PDT) Message-ID: <35dea714-6a0f-4673-fd33-23644ea85d33@linaro.org> Date: Tue, 30 May 2023 17:47:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] lvts_thermal.c: Fix error checking for debugfs_create_dir Content-Language: en-US To: Osama Muhammad , rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, bchihi@baylibre.com, wenst@chromium.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230517160326.10732-1-osmtendev@gmail.com> From: Daniel Lezcano In-Reply-To: <20230517160326.10732-1-osmtendev@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/05/2023 18:03, Osama Muhammad wrote: > This patch fixes the error checking in lvts_thermal.c in > debugfs_create_dir. The correct way to check if an error occurred > is 'IS_ERR' inline function. We do no longer check debugfs functions return values. eg. https://www.spinics.net/lists/linux-spi/msg37903.html https://lore.kernel.org/lkml/2023052835-oxidant-doily-404f@gregkh/ > Signed-off-by: Osama Muhammad > --- > drivers/thermal/mediatek/lvts_thermal.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c > index d0a3f95b7884..61386be78fa0 100644 > --- a/drivers/thermal/mediatek/lvts_thermal.c > +++ b/drivers/thermal/mediatek/lvts_thermal.c > @@ -188,7 +188,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) > int i; > > lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL); > - if (!lvts_td->dom_dentry) > + if (IS_ERR(lvts_td->dom_dentry)) > return 0; > > for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { > @@ -197,7 +197,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) > > sprintf(name, "controller%d", i); > dentry = debugfs_create_dir(name, lvts_td->dom_dentry); > - if (!dentry) > + if (IS_ERR(dentry)) > continue; > > regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL); -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog