From: Jiri Slaby <jirislaby@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>,
Luis Chamberlain <mcgrof@kernel.org>,
Minjie Du <duminjie@vivo.com>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Cc: opensource.kernel@vivo.com, LKML <linux-kernel@vger.kernel.org>,
Kalle Valo <kvalo@kernel.org>,
Nick Kossifidis <mickflemm@gmail.com>
Subject: Re: [PATCH] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device
Date: Thu, 13 Jul 2023 07:47:53 +0200 [thread overview]
Message-ID: <986bc150-1ab3-4ec1-dd76-d3be69bfcef9@kernel.org> (raw)
In-Reply-To: <3e831a9c-b469-f1d3-1eaf-c9e275a74da5@web.de>
On 12. 07. 23, 21:07, Markus Elfring wrote:
>>> +++ b/drivers/net/wireless/ath/ath5k/debug.c
>>> @@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
>>> ah->debug.level = ath5k_debug;
>>>
>>> phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
>> - if (!phydir)
>>> + if (IS_ERR(phydir))
>>
>> Please use IS_ERR_OR_NULL() instead.
>
> I find your support for consistent error detection interesting here.
> Contributors for other Linux software components provide different
> development views.
IS_ERR_OR_NULL() is almost never correct. It is used exceptionally in
cases where one needs to distinct three states. It's not the case for
sysfs/debugfs interfaces.
> Would a subject like “[PATCH v2] ath5k: Fix an error check in ath5k_debug_init_device()”
> be more appropriate?
Yes (pointing out specifically "()" at the end). And add the "why" part
to the message log too, please.
thanks,
--
js
suse labs
next prev parent reply other threads:[~2023-07-13 5:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 12:42 [PATCH v1] " Minjie Du
2023-07-12 18:27 ` Luis Chamberlain
[not found] ` <3e831a9c-b469-f1d3-1eaf-c9e275a74da5@web.de>
2023-07-13 5:47 ` Jiri Slaby [this message]
2023-07-24 8:01 ` [PATCH] " Dan Carpenter
2023-07-13 16:00 ` [PATCH v1] " Jeff Johnson
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=986bc150-1ab3-4ec1-dd76-d3be69bfcef9@kernel.org \
--to=jirislaby@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=duminjie@vivo.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mickflemm@gmail.com \
--cc=opensource.kernel@vivo.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
all inboxes | Powered by JetHome®