diff mbox series

[-next] ionic: Remove redundant null pointer checks in ionic_debugfs_add_qcq()

Message ID 20240903143149.2004530-1-lizetao1@huawei.com (mailing list archive)
State Accepted
Commit 4614ac219e3f441c64d98d684edbdc8945d49dcc
Delegated to: Netdev Maintainers
Headers show
Series [-next] ionic: Remove redundant null pointer checks in ionic_debugfs_add_qcq() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-04--15-00 (tests: 718)

Commit Message

lizetao Sept. 3, 2024, 2:31 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/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brett Creeley Sept. 3, 2024, 4:36 p.m. UTC | #1
On 9/3/2024 7:31 AM, Li Zetao wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> 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/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
> index 59e5a9f21105..c98b4e75e288 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
> @@ -123,7 +123,7 @@ void ionic_debugfs_add_qcq(struct ionic_lif *lif, struct ionic_qcq *qcq)
>          struct ionic_cq *cq = &qcq->cq;
> 
>          qcq_dentry = debugfs_create_dir(q->name, lif->dentry);
> -       if (IS_ERR_OR_NULL(qcq_dentry))
> +       if (IS_ERR(qcq_dentry))
>                  return;

For the patch contents this LGTM.

However, the patch subject prefix should be "[PATCH net-next]" for the 
first version. Specifically, replace "-next" with "net-next".

Thanks,

Brett

>          qcq->dentry = qcq_dentry;
> 
> --
> 2.34.1
>
Jakub Kicinski Sept. 5, 2024, midnight UTC | #2
On Tue, 3 Sep 2024 09:36:22 -0700 Brett Creeley wrote:
> For the patch contents this LGTM.
> 
> However, the patch subject prefix should be "[PATCH net-next]" for the 
> first version. Specifically, replace "-next" with "net-next".

That's right, Li Zetao please follow this advice going forward.
Since it looks like CI guessed the tree correctly I'll apply v1.
patchwork-bot+netdevbpf@kernel.org Sept. 5, 2024, 12:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 3 Sep 2024 22:31:49 +0800 you 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/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [-next] ionic: Remove redundant null pointer checks in ionic_debugfs_add_qcq()
    https://git.kernel.org/netdev/net-next/c/4614ac219e3f

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
index 59e5a9f21105..c98b4e75e288 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
@@ -123,7 +123,7 @@  void ionic_debugfs_add_qcq(struct ionic_lif *lif, struct ionic_qcq *qcq)
 	struct ionic_cq *cq = &qcq->cq;
 
 	qcq_dentry = debugfs_create_dir(q->name, lif->dentry);
-	if (IS_ERR_OR_NULL(qcq_dentry))
+	if (IS_ERR(qcq_dentry))
 		return;
 	qcq->dentry = qcq_dentry;