linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Osama Muhammad <osmtendev@gmail.com>
Cc: krzysztof.kozlowski@linaro.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, nbd@nbd.name,
	ryder.lee@mediatek.com, lorenzo@kernel.org,
	shayne.chen@mediatek.com, davem@davemloft.net,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] nfcsim.c: Fix error checking for debugfs_create_dir
Date: Thu, 25 May 2023 10:12:19 +0200	[thread overview]
Message-ID: <ZG8YY/r8BLCzw93q@corigine.com> (raw)
In-Reply-To: <20230524160352.19704-1-osmtendev@gmail.com> <20230524155506.19353-1-osmtendev@gmail.com>

On Wed, May 24, 2023 at 08:55:06PM +0500, Osama Muhammad wrote:
> This patch fixes the error checking in nfcsim.c in
> debugfs_create_dir. The correct way to check if an error occurred
> is using 'IS_ERR' inline function.
> 
> Signed-off-by: Osama Muhammad <osmtendev@gmail.com>

...

On Wed, May 24, 2023 at 09:03:52PM +0500, Osama Muhammad wrote:
> This patch fixes the error checking in debugfs.c in
> debugfs_create_dir. The correct way to check if an error occurred
> is using 'IS_ERR' inline function.
> 
> Signed-off-by: Osama Muhammad <osmtendev@gmail.com>

...

The comment above debugfs_create_dir includes the following text.

 * NOTE: it's expected that most callers should _ignore_ the errors returned
 * by this function. Other debugfs functions handle the fact that the "dentry"
 * passed to them could be an error and they don't crash in that case.
 * Drivers should generally work fine even if debugfs fails to init anyway.

And I notice that in this same file there are calls to debugfs_create_dir()
where that advice is followed: the return value is ignored.

So I think the correct approaches here are to either:

1. Do nothing, the code isn't really broken
2. Remove the error checking

-- 
pw-bot: cr


  parent reply	other threads:[~2023-05-25  8:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 16:03 [PATCH] debugfs.c: Fix error checking for debugfs_create_dir Osama Muhammad
     [not found] ` <20230524155506.19353-1-osmtendev@gmail.com>
2023-05-25  8:12   ` Simon Horman [this message]
2023-05-30 10:29 ` Kalle Valo
2023-05-30 11:02   ` Osama Muhammad
2023-05-30 11:19     ` Osama Muhammad

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=ZG8YY/r8BLCzw93q@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=osmtendev@gmail.com \
    --cc=ryder.lee@mediatek.com \
    --cc=shayne.chen@mediatek.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 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).