wifi: cfg80211: get rid of gfp in cfg80211_bss_color_notify
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 1 Feb 2023 12:48:30 +0000 (13:48 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 14 Feb 2023 11:35:02 +0000 (12:35 +0100)
Since cfg80211_bss_color_notify() is now always run in non-atomic
context, get rid of gfp_t flags in the routine signature and always use
GFP_KERNEL for netlink message allocation.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/c687724e7b53556f7a2d9cbe3d11cdcf065cb687.1675255390.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/mac80211/cfg.c
net/wireless/nl80211.c

index 9b015bb877db2cc75f2f2879229bc2aa4fb90ab2..c65f17d74191c67810f47aa3e31801dd3180731e 100644 (file)
@@ -8936,12 +8936,11 @@ void cfg80211_bss_flush(struct wiphy *wiphy);
 /**
  * cfg80211_bss_color_notify - notify about bss color event
  * @dev: network device
- * @gfp: allocation flags
  * @cmd: the actual event we want to notify
  * @count: the number of TBTTs until the color change happens
  * @color_bitmap: representations of the colors that the local BSS is aware of
  */
-int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
+int cfg80211_bss_color_notify(struct net_device *dev,
                              enum nl80211_commands cmd, u8 count,
                              u64 color_bitmap);
 
@@ -8952,10 +8951,9 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
  * @gfp: allocation flags
  */
 static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
-                                                      u64 color_bitmap, gfp_t gfp)
+                                                      u64 color_bitmap)
 {
-       return cfg80211_bss_color_notify(dev, gfp,
-                                        NL80211_CMD_OBSS_COLOR_COLLISION,
+       return cfg80211_bss_color_notify(dev, NL80211_CMD_OBSS_COLOR_COLLISION,
                                         0, color_bitmap);
 }
 
@@ -8969,8 +8967,7 @@ static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
 static inline int cfg80211_color_change_started_notify(struct net_device *dev,
                                                       u8 count)
 {
-       return cfg80211_bss_color_notify(dev, GFP_KERNEL,
-                                        NL80211_CMD_COLOR_CHANGE_STARTED,
+       return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_STARTED,
                                         count, 0);
 }
 
@@ -8982,8 +8979,7 @@ static inline int cfg80211_color_change_started_notify(struct net_device *dev,
  */
 static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
 {
-       return cfg80211_bss_color_notify(dev, GFP_KERNEL,
-                                        NL80211_CMD_COLOR_CHANGE_ABORTED,
+       return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_ABORTED,
                                         0, 0);
 }
 
@@ -8995,7 +8991,7 @@ static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
  */
 static inline int cfg80211_color_change_notify(struct net_device *dev)
 {
-       return cfg80211_bss_color_notify(dev, GFP_KERNEL,
+       return cfg80211_bss_color_notify(dev,
                                         NL80211_CMD_COLOR_CHANGE_COMPLETED,
                                         0, 0);
 }
index d2519a4db653e6a230dc947db386f7510e453a8f..8eb3423008687a3f09c3512d8adbb00b19579695 100644 (file)
@@ -4678,8 +4678,7 @@ void ieee80211_color_collision_detection_work(struct work_struct *work)
        struct ieee80211_sub_if_data *sdata = link->sdata;
 
        sdata_lock(sdata);
-       cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap,
-                                            GFP_KERNEL);
+       cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap);
        sdata_unlock(sdata);
 }
 
index 4f112d75ac9cb2db3f12a612934cb5e19d92996d..112b4bb009c80f648748256b322d9a5e7a7e8514 100644 (file)
@@ -19174,7 +19174,7 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev,
 }
 EXPORT_SYMBOL(cfg80211_ch_switch_started_notify);
 
-int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
+int cfg80211_bss_color_notify(struct net_device *dev,
                              enum nl80211_commands cmd, u8 count,
                              u64 color_bitmap)
 {
@@ -19188,7 +19188,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
 
        trace_cfg80211_bss_color_notify(dev, cmd, count, color_bitmap);
 
-       msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+       msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
        if (!msg)
                return -ENOMEM;
 
@@ -19211,7 +19211,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
        genlmsg_end(msg, hdr);
 
        return genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
-                                      msg, 0, NL80211_MCGRP_MLME, gfp);
+                                      msg, 0, NL80211_MCGRP_MLME, GFP_KERNEL);
 
 nla_put_failure:
        nlmsg_free(msg);