diff mbox series

[-next] efi: Remove redundant null pointer checks in efi_debugfs_init()

Message ID 20240903144115.2005448-1-lizetao1@huawei.com
State Accepted
Commit 04736f7d1945722117def1462fd3602c72c02272
Headers show
Series [-next] efi: Remove redundant null pointer checks in efi_debugfs_init() | expand

Commit Message

Li Zetao Sept. 3, 2024, 2:41 p.m. UTC
Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, and using IS_ERR is
safe enough.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
---
 drivers/firmware/efi/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ard Biesheuvel Sept. 13, 2024, 2:26 p.m. UTC | #1
On Tue, 3 Sept 2024 at 16:32, Li Zetao <lizetao1@huawei.com> wrote:
>
> Since the debugfs_create_dir() never returns a null pointer, checking
> the return value for a null pointer is redundant, and using IS_ERR is
> safe enough.
>
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> ---
>  drivers/firmware/efi/efi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index fdf07dd6f459..70490bf2697b 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -349,7 +349,7 @@ static void __init efi_debugfs_init(void)
>         int i = 0;
>
>         efi_debugfs = debugfs_create_dir("efi", NULL);
> -       if (IS_ERR_OR_NULL(efi_debugfs))
> +       if (IS_ERR(efi_debugfs))
>                 return;
>
>         for_each_efi_memory_desc(md) {

Queued in efi/next

Thanks,
diff mbox series

Patch

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index fdf07dd6f459..70490bf2697b 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -349,7 +349,7 @@  static void __init efi_debugfs_init(void)
 	int i = 0;
 
 	efi_debugfs = debugfs_create_dir("efi", NULL);
-	if (IS_ERR_OR_NULL(efi_debugfs))
+	if (IS_ERR(efi_debugfs))
 		return;
 
 	for_each_efi_memory_desc(md) {