diff mbox series

[1/2] cfg80211: Remove unused cfg80211_background_cac_abort

Message ID 20241006225303.121445-2-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, 29 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_background_cac_abort() is unused.
It got renamed from cfg80211_offchan_cac_abort by commit
a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")

and that was originally added in commit
1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
but never used.

To me it looks like the queue is still used (I see a queue_work
in __cfg80211_radar_event), so I think it's just the wrapper that's
unused.

Remove cfg80211_background_cac_abort.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 include/net/cfg80211.h | 9 ---------
 net/wireless/mlme.c    | 8 --------
 2 files changed, 17 deletions(-)

Comments

Vasanthakumar Thiagarajan Oct. 7, 2024, 6:59 a.m. UTC | #1
On 10/7/2024 4:23 AM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> cfg80211_background_cac_abort() is unused.
> It got renamed from cfg80211_offchan_cac_abort by commit
> a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")
> 
> and that was originally added in commit
> 1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
> but never used.
> 
> To me it looks like the queue is still used (I see a queue_work
> in __cfg80211_radar_event), so I think it's just the wrapper that's
> unused.
> 
> Remove cfg80211_background_cac_abort.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>   include/net/cfg80211.h | 9 ---------
>   net/wireless/mlme.c    | 8 --------
>   2 files changed, 17 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 69ec1eb41a09..fd843a519329 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -8752,15 +8752,6 @@ void cfg80211_cac_event(struct net_device *netdev,
>   			enum nl80211_radar_event event, gfp_t gfp,
>   			unsigned int link_id);
>   
> -/**
> - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
> - * @wiphy: the wiphy
> - *
> - * This function is called by the driver when a Channel Availability Check
> - * (CAC) is aborted by a offchannel dedicated chain.
> - */
> -void cfg80211_background_cac_abort(struct wiphy *wiphy);
> -
>   /**
>    * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
>    * @dev: network device
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index 4dac81854721..8ec236bbbc7c 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work)
>   				      NL80211_RADAR_CAC_ABORTED);
>   }
>   
> -void cfg80211_background_cac_abort(struct wiphy *wiphy)
> -{
> -	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
> -
> -	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
> -}
> -EXPORT_SYMBOL(cfg80211_background_cac_abort);
> -

We have an internal WIP ath driver implementation for background radar feature
calling this function to notify the background CAC abort state. There is definitely
real use case for this function.

Vasanth
Dr. David Alan Gilbert Oct. 7, 2024, 11:02 a.m. UTC | #2
* Vasanthakumar Thiagarajan (quic_vthiagar@quicinc.com) wrote:
> 
> 
> On 10/7/2024 4:23 AM, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > cfg80211_background_cac_abort() is unused.
> > It got renamed from cfg80211_offchan_cac_abort by commit
> > a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")
> > 
> > and that was originally added in commit
> > 1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
> > but never used.
> > 
> > To me it looks like the queue is still used (I see a queue_work
> > in __cfg80211_radar_event), so I think it's just the wrapper that's
> > unused.
> > 
> > Remove cfg80211_background_cac_abort.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> >   include/net/cfg80211.h | 9 ---------
> >   net/wireless/mlme.c    | 8 --------
> >   2 files changed, 17 deletions(-)
> > 
> > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > index 69ec1eb41a09..fd843a519329 100644
> > --- a/include/net/cfg80211.h
> > +++ b/include/net/cfg80211.h
> > @@ -8752,15 +8752,6 @@ void cfg80211_cac_event(struct net_device *netdev,
> >   			enum nl80211_radar_event event, gfp_t gfp,
> >   			unsigned int link_id);
> > -/**
> > - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
> > - * @wiphy: the wiphy
> > - *
> > - * This function is called by the driver when a Channel Availability Check
> > - * (CAC) is aborted by a offchannel dedicated chain.
> > - */
> > -void cfg80211_background_cac_abort(struct wiphy *wiphy);
> > -
> >   /**
> >    * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
> >    * @dev: network device
> > diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> > index 4dac81854721..8ec236bbbc7c 100644
> > --- a/net/wireless/mlme.c
> > +++ b/net/wireless/mlme.c
> > @@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work)
> >   				      NL80211_RADAR_CAC_ABORTED);
> >   }
> > -void cfg80211_background_cac_abort(struct wiphy *wiphy)
> > -{
> > -	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
> > -
> > -	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
> > -}
> > -EXPORT_SYMBOL(cfg80211_background_cac_abort);
> > -
> 
> We have an internal WIP ath driver implementation for background radar feature
> calling this function to notify the background CAC abort state. There is definitely
> real use case for this function.

OK, fair enough.

What about the other patch?

Dave

> Vasanth
diff mbox series

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 69ec1eb41a09..fd843a519329 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -8752,15 +8752,6 @@  void cfg80211_cac_event(struct net_device *netdev,
 			enum nl80211_radar_event event, gfp_t gfp,
 			unsigned int link_id);
 
-/**
- * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
- * @wiphy: the wiphy
- *
- * This function is called by the driver when a Channel Availability Check
- * (CAC) is aborted by a offchannel dedicated chain.
- */
-void cfg80211_background_cac_abort(struct wiphy *wiphy);
-
 /**
  * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
  * @dev: network device
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 4dac81854721..8ec236bbbc7c 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -1226,14 +1226,6 @@  void cfg80211_background_cac_abort_wk(struct work_struct *work)
 				      NL80211_RADAR_CAC_ABORTED);
 }
 
-void cfg80211_background_cac_abort(struct wiphy *wiphy)
-{
-	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
-
-	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
-}
-EXPORT_SYMBOL(cfg80211_background_cac_abort);
-
 int
 cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
 					  struct wireless_dev *wdev,