diff mbox series

[2/2] cfg80211: Remove unused cfg80211_vendor_ functions

Message ID 20241006225303.121445-3-linux@treblig.org (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series Some cfg80211 deadcode removal | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 (+1) this patch: 0 (+1)
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 23 this patch: 23
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 74 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-10-07--00-00 (tests: 775)

Commit Message

Dr. David Alan Gilbert Oct. 6, 2024, 10:53 p.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
were added in 2019 by commit
55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")

but never used.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 include/net/cfg80211.h | 45 ------------------------------------------
 net/wireless/nl80211.c | 11 -----------
 2 files changed, 56 deletions(-)

Comments

Johannes Berg Oct. 7, 2024, 11:04 a.m. UTC | #1
On Sun, 2024-10-06 at 23:53 +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
> were added in 2019 by commit
> 55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")
> 
> but never used.
> 

Yeah ... we have out-of-tree code using this for CSI matrix stuff
(sensing), but I guess we can keep this API out-of-tree just as well,
though it'll make it harder to integrate in ChromeOS.

johannes
Dr. David Alan Gilbert Oct. 7, 2024, 11:29 a.m. UTC | #2
* Johannes Berg (johannes@sipsolutions.net) wrote:
> On Sun, 2024-10-06 at 23:53 +0100, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
> > were added in 2019 by commit
> > 55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")
> > 
> > but never used.
> > 
> 
> Yeah ... we have out-of-tree code using this for CSI matrix stuff
> (sensing), but I guess we can keep this API out-of-tree just as well,
> though it'll make it harder to integrate in ChromeOS.

Obviously it's the maintainers call as which way to go.
I guess the best outcome would be for that out-of-tree code to land in
the tree!

Dave

> johannes
>
diff mbox series

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index fd843a519329..cd3ed718efe2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -7806,16 +7806,6 @@  cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
  */
 int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
 
-/**
- * cfg80211_vendor_cmd_get_sender - get the current sender netlink ID
- * @wiphy: the wiphy
- *
- * Return: the current netlink port ID in a vendor command handler.
- *
- * Context: May only be called from a vendor command handler
- */
-unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy);
-
 /**
  * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
  * @wiphy: the wiphy
@@ -7846,41 +7836,6 @@  cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct wireless_dev *wdev,
 					  0, event_idx, approxlen, gfp);
 }
 
-/**
- * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb
- * @wiphy: the wiphy
- * @wdev: the wireless device
- * @event_idx: index of the vendor event in the wiphy's vendor_events
- * @portid: port ID of the receiver
- * @approxlen: an upper bound of the length of the data that will
- *	be put into the skb
- * @gfp: allocation flags
- *
- * This function allocates and pre-fills an skb for an event to send to
- * a specific (userland) socket. This socket would previously have been
- * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take
- * care to register a netlink notifier to see when the socket closes.
- *
- * If wdev != NULL, both the ifindex and identifier of the specified
- * wireless device are added to the event message before the vendor data
- * attribute.
- *
- * When done filling the skb, call cfg80211_vendor_event() with the
- * skb to send the event.
- *
- * Return: An allocated and pre-filled skb. %NULL if any errors happen.
- */
-static inline struct sk_buff *
-cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  unsigned int portid, int approxlen,
-				  int event_idx, gfp_t gfp)
-{
-	return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
-					  NL80211_ATTR_VENDOR_DATA,
-					  portid, event_idx, approxlen, gfp);
-}
-
 /**
  * cfg80211_vendor_event - send the event
  * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 9ab777e0bd4d..674ab5fa6da0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -15416,17 +15416,6 @@  int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
 }
 EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
 
-unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy)
-{
-	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
-
-	if (WARN_ON(!rdev->cur_cmd_info))
-		return 0;
-
-	return rdev->cur_cmd_info->snd_portid;
-}
-EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_get_sender);
-
 static int nl80211_set_qos_map(struct sk_buff *skb,
 			       struct genl_info *info)
 {