* [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init()
@ 2023-09-21 9:10 Minjie Du
2023-09-25 13:45 ` Alexandre Mergnat
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Minjie Du @ 2023-09-21 9:10 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Philipp Zabel, Matthias Brugger, AngeloGioacchino Del Regno,
Alexandre Mergnat, Nícolas F. R. A. Prado, Minjie Du,
Chen-Yu Tsai, Balsam CHIHI, open list:THERMAL, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
Cc: opensource.kernel
debugfs_create_dir() function returns an error value embedded in
the pointer (PTR_ERR). Evaluate the return value using IS_ERR
rather than checking for NULL.
Signed-off-by: Minjie Du <duminjie@vivo.com>
---
drivers/thermal/mediatek/lvts_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index effd9b00a424..88240600e6ce 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -213,7 +213,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);
--
2.39.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init()
2023-09-21 9:10 [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init() Minjie Du
@ 2023-09-25 13:45 ` Alexandre Mergnat
2023-09-26 4:00 ` Chen-Yu Tsai
2023-09-28 13:59 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Mergnat @ 2023-09-25 13:45 UTC (permalink / raw)
To: Minjie Du, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
Zhang Rui, Philipp Zabel, Matthias Brugger,
AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
Chen-Yu Tsai, Balsam CHIHI, open list:THERMAL, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
Cc: opensource.kernel
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
On 21/09/2023 11:10, Minjie Du wrote:
> debugfs_create_dir() function returns an error value embedded in
> the pointer (PTR_ERR). Evaluate the return value using IS_ERR
> rather than checking for NULL.
--
Regards,
Alexandre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init()
2023-09-21 9:10 [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init() Minjie Du
2023-09-25 13:45 ` Alexandre Mergnat
@ 2023-09-26 4:00 ` Chen-Yu Tsai
2023-09-28 13:59 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2023-09-26 4:00 UTC (permalink / raw)
To: Minjie Du
Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Philipp Zabel, Matthias Brugger, AngeloGioacchino Del Regno,
Alexandre Mergnat, Nícolas F. R. A. Prado, Balsam CHIHI,
open list:THERMAL, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support, opensource.kernel
On Thu, Sep 21, 2023 at 5:11 PM Minjie Du <duminjie@vivo.com> wrote:
>
> debugfs_create_dir() function returns an error value embedded in
> the pointer (PTR_ERR). Evaluate the return value using IS_ERR
> rather than checking for NULL.
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init()
2023-09-21 9:10 [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init() Minjie Du
2023-09-25 13:45 ` Alexandre Mergnat
2023-09-26 4:00 ` Chen-Yu Tsai
@ 2023-09-28 13:59 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2023-09-28 13:59 UTC (permalink / raw)
To: Minjie Du, Rafael J. Wysocki, Amit Kucheria, Zhang Rui,
Philipp Zabel, Matthias Brugger, AngeloGioacchino Del Regno,
Alexandre Mergnat, Nícolas F. R. A. Prado, Chen-Yu Tsai,
Balsam CHIHI, open list:THERMAL, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
Cc: opensource.kernel
On 21/09/2023 11:10, Minjie Du wrote:
> debugfs_create_dir() function returns an error value embedded in
> the pointer (PTR_ERR). Evaluate the return value using IS_ERR
> rather than checking for NULL.
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-28 13:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21 9:10 [PATCH v1] thermal/drivers/mediatek/lvts_thermal: fix error check in lvts_debugfs_init() Minjie Du
2023-09-25 13:45 ` Alexandre Mergnat
2023-09-26 4:00 ` Chen-Yu Tsai
2023-09-28 13:59 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).