Subject: Re: [PATCH] PCI/bwctrl: Remove unused pcie_bwctrl_lbms_rwsem

From: Ilpo Järvinen <[email-masked]>
Date: Thu, 8 May 2025 11:59:56 +0300 (EEST)

On Wed, 7 May 2025, Paul E. McKenney wrote:

> PCI/bwctrl: Remove unused pcie_bwctrl_lbms_rwsem
> 
> Builds with CONFIG_PREEMPT_RT=y get the following build error:
> 
> drivers/pci/pcie/bwctrl.c:56:22: error: ‘pcie_bwctrl_lbms_rwsem’ defined but not used [-Werror=unused-variable]
> 
> Therefore, remove this unused variable.  Perhaps this should be folded
> into the commit shown below.
> 
> Fixes: 0238f352a63a ("PCI/bwctrl: Replace lbms_count with PCI_LINK_LBMS_SEEN flag")
> Signed-off-by: Paul E. McKenney <[email-masked]>
> Cc: "Ilpo Järvinen" <[email-masked]>
> Cc: Bjorn Helgaas <[email-masked]>
> Cc: <[email-masked]>
> 
> diff --git a/drivers/pci/pcie/bwctrl.c b/drivers/pci/pcie/bwctrl.c
> index fdafa20e4587d..841ab8725aff7 100644
> --- a/drivers/pci/pcie/bwctrl.c
> +++ b/drivers/pci/pcie/bwctrl.c
> @@ -53,7 +53,6 @@ struct pcie_bwctrl_data {
>   * (using just one rwsem triggers "possible recursive locking detected"
>   * warning).
>   */
> -static DECLARE_RWSEM(pcie_bwctrl_lbms_rwsem);
>  static DECLARE_RWSEM(pcie_bwctrl_setspeed_rwsem);
>  
>  static bool pcie_valid_speed(enum pci_bus_speed speed)
> 

I've a patch which removes not only the rwsem but also the comment details 
related to it. I've just not sent it yet because lkp has been very cranky 
recently to build test things in a reasonable time.

-- 
 i.