diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-02-21 00:04:20 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:54 -0500 |
commit | 85fd129a721e6e892dbaaf05203baf819730f699 (patch) | |
tree | 9e8563ce2e42ad4a6b426984b9067448a3a4129b /net/wireless/core.h | |
parent | b5850a7a4fd5bcab4f6a2c49e5b4ab9ebb1d5d44 (diff) |
cfg80211: add wiphy_idx_valid to check for wiphy_idx sanity
This will later be used by others, for now make use of it in
cfg80211_drv_by_wiphy_idx() to return early if an invalid
wiphy_idx has been provided.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r-- | net/wireless/core.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h index 178378124800..4f2e0fe38ce3 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h @@ -63,6 +63,13 @@ struct cfg80211_registered_device *wiphy_to_dev(struct wiphy *wiphy) return container_of(wiphy, struct cfg80211_registered_device, wiphy); } +/* Note 0 is valid, hence phy0 */ +static inline +bool wiphy_idx_valid(int wiphy_idx) +{ + return (wiphy_idx >= 0); +} + extern struct mutex cfg80211_drv_mutex; extern struct list_head cfg80211_drv_list; |