Re: [PATCH] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux