Commit c216e641 authored by Arend van Spriel's avatar Arend van Spriel Committed by Johannes Berg

cfg80211: change function signature of cfg80211_get_p2p_attr()

The function cfg80211_get_p2p_attr() can fail and returns
a negative error code. However, the return type is unsigned
int. The largest positive number is determined by desired_len
variable in the function, which is u16. So changing the return
type to int to allow easy error checking. Also change the type
for the attribute to enum for improved type checking.
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
[fix indentation, don't use u8 attr variable]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0172bb75
...@@ -3652,8 +3652,9 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev); ...@@ -3652,8 +3652,9 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev);
* the data is malformed or the attribute can't be found (respectively), * the data is malformed or the attribute can't be found (respectively),
* or the length of the found attribute (which can be zero). * or the length of the found attribute (which can be zero).
*/ */
unsigned int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
u8 attr, u8 *buf, unsigned int bufsize); enum ieee80211_p2p_attr_id attr,
u8 *buf, unsigned int bufsize);
/* Logging, debugging and troubleshooting/diagnostic helpers. */ /* Logging, debugging and troubleshooting/diagnostic helpers. */
......
...@@ -980,8 +980,9 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate) ...@@ -980,8 +980,9 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate)
} }
EXPORT_SYMBOL(cfg80211_calculate_bitrate); EXPORT_SYMBOL(cfg80211_calculate_bitrate);
unsigned int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
u8 attr, u8 *buf, unsigned int bufsize) enum ieee80211_p2p_attr_id attr,
u8 *buf, unsigned int bufsize)
{ {
u8 *out = buf; u8 *out = buf;
u16 attr_remaining = 0; u16 attr_remaining = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment