Re: [PATCH] lvts_thermal.c: Drop error checking for debugfs_create_dir

From: Daniel Lezcano
Date: Tue Jun 13 2023 - 04:41:27 EST


On 30/05/2023 19:24, Osama Muhammad wrote:
This patch removes the error checking for debugfs_create_dir
in lvts_thermal.c. This is because the debugfs_create_dir()
does not return NULL but an ERR_PTR after an error.
The DebugFS kernel API is developed in a way that the
caller can safely ignore the errors that occur during
the creation of DebugFS nodes.The debugfs Api handles
it gracefully. The check is unnecessary.

Link to the comment above debugfs_create_dir:
https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L451

Signed-off-by: Osama Muhammad <osmtendev@xxxxxxxxx>

Is this patch tested ?



--
<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