Skip to content

Commit

Permalink
wifi: mac80211: remove return value check of debugfs_create_dir()
Browse files Browse the repository at this point in the history
Smatch complains that:
debugfs_hw_add() warn: 'statsd' is an error pointer or valid

Debugfs checks are generally not supposed to be checked for errors
and it is not necessary here.

Just delete the dead code.

Signed-off-by: Yingsha Xu <ysxu@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230419104548.30124-1-ysxu@hust.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Yingsha Xu authored and Johannes Berg committed Apr 20, 2023
1 parent 22b68fc commit eb74bfc
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/mac80211/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,6 @@ void debugfs_hw_add(struct ieee80211_local *local)

statsd = debugfs_create_dir("statistics", phyd);

/* if the dir failed, don't put all the other things into the root! */
if (!statsd)
return;

#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
DEBUGFS_STATS_ADD(dot11TransmittedFragmentCount);
DEBUGFS_STATS_ADD(dot11MulticastTransmittedFrameCount);
Expand Down

0 comments on commit eb74bfc

Please sign in to comment.