All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <gregory.greenman@intel.com>, <kvalo@kernel.org>,
	<briannorris@chromium.org>, <nbd@nbd.name>, <lorenzo@kernel.org>,
	<ryder.lee@mediatek.com>, <shayne.chen@mediatek.com>,
	<sean.wang@mediatek.com>, <matthias.bgg@gmail.com>,
	<angelogioacchino.delregno@collabora.com>,
	<avraham.stern@intel.com>, <johannes.berg@intel.com>,
	<emmanuel.grumbach@intel.com>, <trix@redhat.com>,
	<dmantipov@yandex.ru>, <christophe.jaillet@wanadoo.fr>,
	<yangyang@marvell.com>, <linville@tuxdriver.com>,
	<rramesh@marvell.com>, <akarwar@marvell.com>,
	<nishants@marvell.com>, <linux-wireless@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Bing Zhao <bzhao@marvell.com>, Frank Huang <frankh@marvell.com>,
	Kiran Divekar <dkiran@marvell.com>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH wireless-next v2 2/3] mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir()
Date: Sun, 3 Sep 2023 11:02:15 +0800	[thread overview]
Message-ID: <20230903030216.1509013-3-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230903030216.1509013-1-ruanjinjie@huawei.com>

debugfs_create_dir() returns ERR_PTR and never return NULL.

As Russell suggested, this patch removes the error checking for
debugfs_create_dir(). This is because 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 APIs have a IS_ERR() judge in
start_creating() which can handle it gracefully. So these checks are
unnecessary.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
---
v2:
- Remove the err check instead of using IS_ERR to replace NULL check.
- Update the commit message and title.
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index f9c9fec7c792..d14a0f4c1b6d 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -970,9 +970,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name,
 					       mwifiex_dfs_dir);
 
-	if (!priv->dfs_dev_dir)
-		return;
-
 	MWIFIEX_DFS_ADD_FILE(info);
 	MWIFIEX_DFS_ADD_FILE(debug);
 	MWIFIEX_DFS_ADD_FILE(getlog);
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <gregory.greenman@intel.com>, <kvalo@kernel.org>,
	<briannorris@chromium.org>, <nbd@nbd.name>, <lorenzo@kernel.org>,
	<ryder.lee@mediatek.com>, <shayne.chen@mediatek.com>,
	<sean.wang@mediatek.com>, <matthias.bgg@gmail.com>,
	<angelogioacchino.delregno@collabora.com>,
	<avraham.stern@intel.com>, <johannes.berg@intel.com>,
	<emmanuel.grumbach@intel.com>, <trix@redhat.com>,
	<dmantipov@yandex.ru>, <christophe.jaillet@wanadoo.fr>,
	<yangyang@marvell.com>, <linville@tuxdriver.com>,
	<rramesh@marvell.com>, <akarwar@marvell.com>,
	<nishants@marvell.com>, <linux-wireless@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Bing Zhao <bzhao@marvell.com>, Frank Huang <frankh@marvell.com>,
	Kiran Divekar <dkiran@marvell.com>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH wireless-next v2 2/3] mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir()
Date: Sun, 3 Sep 2023 11:02:15 +0800	[thread overview]
Message-ID: <20230903030216.1509013-3-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230903030216.1509013-1-ruanjinjie@huawei.com>

debugfs_create_dir() returns ERR_PTR and never return NULL.

As Russell suggested, this patch removes the error checking for
debugfs_create_dir(). This is because 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 APIs have a IS_ERR() judge in
start_creating() which can handle it gracefully. So these checks are
unnecessary.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
---
v2:
- Remove the err check instead of using IS_ERR to replace NULL check.
- Update the commit message and title.
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index f9c9fec7c792..d14a0f4c1b6d 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -970,9 +970,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name,
 					       mwifiex_dfs_dir);
 
-	if (!priv->dfs_dev_dir)
-		return;
-
 	MWIFIEX_DFS_ADD_FILE(info);
 	MWIFIEX_DFS_ADD_FILE(debug);
 	MWIFIEX_DFS_ADD_FILE(getlog);
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-09-03  3:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03  3:02 [PATCH wireless-next v2 0/3] wifi: Drop unnecessary error checks for debugfs_create_dir() Jinjie Ruan
2023-09-03  3:02 ` Jinjie Ruan
2023-09-03  3:02 ` [PATCH wireless-next v2 1/3] wifi: iwlwifi: mei: Drop unnecessary error check " Jinjie Ruan
2023-09-03  3:02   ` Jinjie Ruan
2023-09-03  3:02 ` Jinjie Ruan [this message]
2023-09-03  3:02   ` [PATCH wireless-next v2 2/3] mwifiex: debugfs: " Jinjie Ruan
2024-01-18 13:06   ` [wireless-next,v2,2/3] wifi: " Kalle Valo
2024-01-18 13:06     ` Kalle Valo
2023-09-03  3:02 ` [PATCH wireless-next v2 3/3] wifi: mt76: " Jinjie Ruan
2023-09-03  3:02   ` Jinjie Ruan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230903030216.1509013-3-ruanjinjie@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=akarwar@marvell.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=avraham.stern@intel.com \
    --cc=briannorris@chromium.org \
    --cc=bzhao@marvell.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dkiran@marvell.com \
    --cc=dmantipov@yandex.ru \
    --cc=emmanuel.grumbach@intel.com \
    --cc=frankh@marvell.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=nishants@marvell.com \
    --cc=rramesh@marvell.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    --cc=trix@redhat.com \
    --cc=yangyang@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.