Skip to content

Commit 5a7bb7c

Browse files
gregkhjmberg-intel
authored andcommitted
mac80211: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Johannes Berg <johannes@sipsolutions.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 163a7cd commit 5a7bb7c

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

‎net/mac80211/debugfs_key.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
342342
key->debugfs.dir = debugfs_create_dir(buf,
343343
key->local->debugfs.keys);
344344

345-
if (!key->debugfs.dir)
346-
return;
347-
348345
sta = key->sta;
349346
if (sta) {
350347
sprintf(buf, "../../netdev:%s/stations/%pM",

‎net/mac80211/debugfs_netdev.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,8 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
818818
sprintf(buf, "netdev:%s", sdata->name);
819819
sdata->vif.debugfs_dir = debugfs_create_dir(buf,
820820
sdata->local->hw.wiphy->debugfsdir);
821-
if (sdata->vif.debugfs_dir)
822-
sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
823-
sdata->vif.debugfs_dir);
821+
sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
822+
sdata->vif.debugfs_dir);
824823
add_files(sdata);
825824
}
826825

@@ -845,8 +844,5 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
845844
return;
846845

847846
sprintf(buf, "netdev:%s", sdata->name);
848-
if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
849-
sdata_err(sdata,
850-
"debugfs: failed to rename debugfs dir to %s\n",
851-
buf);
847+
debugfs_rename(dir->d_parent, dir, dir->d_parent, buf);
852848
}

‎net/mac80211/debugfs_sta.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
960960
* dir might still be around.
961961
*/
962962
sta->debugfs_dir = debugfs_create_dir(mac, stations_dir);
963-
if (!sta->debugfs_dir)
964-
return;
965963

966964
DEBUGFS_ADD(flags);
967965
DEBUGFS_ADD(aid);

0 commit comments

Comments
 (0)