wifi: cfg80211: make some regulatory functions void
authorJohannes Berg <johannes.berg@intel.com>
Fri, 19 Apr 2024 08:25:48 +0000 (10:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 19 Apr 2024 08:28:25 +0000 (10:28 +0200)
The return value of regulatory_hint_indoor() is always 0 for
success, and the return value of regulatory_hint_found_beacon()
is always ignored. Make them both have void return.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c
net/wireless/reg.c
net/wireless/reg.h

index b4edba6b0b7ba0bf3200c7ce966a3e286a6fdf24..e5d8ea4211ea12384f15f12bfa2ac296abb56bf6 100644 (file)
@@ -8116,7 +8116,8 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
                        is_indoor = true;
                }
 
-               return regulatory_hint_indoor(is_indoor, owner_nlportid);
+               regulatory_hint_indoor(is_indoor, owner_nlportid);
+               return 0;
        default:
                return -EINVAL;
        }
index 753f8e9aa4b1959cb8e98c03132c5c07bd903a43..3cef0021a3db923c3e410d54760d5ea68df065db 100644 (file)
@@ -3284,7 +3284,7 @@ int regulatory_hint_user(const char *alpha2,
        return 0;
 }
 
-int regulatory_hint_indoor(bool is_indoor, u32 portid)
+void regulatory_hint_indoor(bool is_indoor, u32 portid)
 {
        spin_lock(&reg_indoor_lock);
 
@@ -3307,8 +3307,6 @@ int regulatory_hint_indoor(bool is_indoor, u32 portid)
 
        if (!is_indoor)
                reg_check_channels();
-
-       return 0;
 }
 
 void regulatory_netlink_notify(u32 portid)
@@ -3666,9 +3664,9 @@ static bool pending_reg_beacon(struct ieee80211_channel *beacon_chan)
        return false;
 }
 
-int regulatory_hint_found_beacon(struct wiphy *wiphy,
-                                struct ieee80211_channel *beacon_chan,
-                                gfp_t gfp)
+void regulatory_hint_found_beacon(struct wiphy *wiphy,
+                                 struct ieee80211_channel *beacon_chan,
+                                 gfp_t gfp)
 {
        struct reg_beacon *reg_beacon;
        bool processing;
@@ -3677,18 +3675,18 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy,
            beacon_chan->flags & IEEE80211_CHAN_RADAR ||
            (beacon_chan->band == NL80211_BAND_2GHZ &&
             !freq_is_chan_12_13_14(beacon_chan->center_freq)))
-               return 0;
+               return;
 
        spin_lock_bh(&reg_pending_beacons_lock);
        processing = pending_reg_beacon(beacon_chan);
        spin_unlock_bh(&reg_pending_beacons_lock);
 
        if (processing)
-               return 0;
+               return;
 
        reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp);
        if (!reg_beacon)
-               return -ENOMEM;
+               return;
 
        pr_debug("Found new beacon on frequency: %d.%03d MHz (Ch %d) on %s\n",
                 beacon_chan->center_freq, beacon_chan->freq_offset,
@@ -3708,8 +3706,6 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy,
        spin_unlock_bh(&reg_pending_beacons_lock);
 
        schedule_work(&reg_work);
-
-       return 0;
 }
 
 static void print_rd_rules(const struct ieee80211_regdomain *rd)
index a02ef5609f52dc590bcc3b0e6581069b59029c2c..0f839c790a4f279750c2c498a17a5565324f2a34 100644 (file)
@@ -42,7 +42,7 @@ int regulatory_hint_user(const char *alpha2,
  * device is operating in an indoor environment.
  * @portid: the netlink port ID on which the hint was given.
  */
-int regulatory_hint_indoor(bool is_indoor, u32 portid);
+void regulatory_hint_indoor(bool is_indoor, u32 portid);
 
 /**
  * regulatory_netlink_notify - notify on released netlink socket
@@ -82,9 +82,9 @@ bool reg_last_request_cell_base(void);
  * on a newly found BSS. If you cannot make use of this feature you can
  * set the wiphy->disable_beacon_hints to true.
  */
-int regulatory_hint_found_beacon(struct wiphy *wiphy,
-                                struct ieee80211_channel *beacon_chan,
-                                gfp_t gfp);
+void regulatory_hint_found_beacon(struct wiphy *wiphy,
+                                 struct ieee80211_channel *beacon_chan,
+                                 gfp_t gfp);
 
 /**
  * regulatory_hint_country_ie - hints a country IE as a regulatory domain