diff mbox series

[v2,02/20] drivers/base: Remove CONFIG_SRCU

Message ID 20230113001132.3375334-2-paulmck@kernel.org (mailing list archive)
State Accepted
Commit a52f776f6be6e44f9e1eb025a67e05b7dcb0d066
Headers show
Series [v2,01/20] arch/x86: Remove "select SRCU" | expand

Commit Message

Paul E. McKenney Jan. 13, 2023, 12:11 a.m. UTC
Now that the SRCU Kconfig option is unconditionally selected, there is
no longer any point in conditional compilation based on CONFIG_SRCU.
Therefore, remove the #ifdef and throw away the #else clause.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
---
 drivers/base/core.c | 42 ------------------------------------------
 1 file changed, 42 deletions(-)

Comments

Rafael J. Wysocki Jan. 13, 2023, 9:46 a.m. UTC | #1
On Fri, Jan 13, 2023 at 1:11 AM Paul E. McKenney <paulmck@kernel.org> wrote:
>
> Now that the SRCU Kconfig option is unconditionally selected, there is
> no longer any point in conditional compilation based on CONFIG_SRCU.
> Therefore, remove the #ifdef and throw away the #else clause.
>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: John Ogness <john.ogness@linutronix.de>

Acked-by: Rafael J. Wysocki <rafael@kernel.org>

> ---
>  drivers/base/core.c | 42 ------------------------------------------
>  1 file changed, 42 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index a3e14143ec0cf..bb36aca8d1b7a 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -181,7 +181,6 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
>  }
>  EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
>
> -#ifdef CONFIG_SRCU
>  static DEFINE_MUTEX(device_links_lock);
>  DEFINE_STATIC_SRCU(device_links_srcu);
>
> @@ -220,47 +219,6 @@ static void device_link_remove_from_lists(struct device_link *link)
>         list_del_rcu(&link->s_node);
>         list_del_rcu(&link->c_node);
>  }
> -#else /* !CONFIG_SRCU */
> -static DECLARE_RWSEM(device_links_lock);
> -
> -static inline void device_links_write_lock(void)
> -{
> -       down_write(&device_links_lock);
> -}
> -
> -static inline void device_links_write_unlock(void)
> -{
> -       up_write(&device_links_lock);
> -}
> -
> -int device_links_read_lock(void)
> -{
> -       down_read(&device_links_lock);
> -       return 0;
> -}
> -
> -void device_links_read_unlock(int not_used)
> -{
> -       up_read(&device_links_lock);
> -}
> -
> -#ifdef CONFIG_DEBUG_LOCK_ALLOC
> -int device_links_read_lock_held(void)
> -{
> -       return lockdep_is_held(&device_links_lock);
> -}
> -#endif
> -
> -static inline void device_link_synchronize_removal(void)
> -{
> -}
> -
> -static void device_link_remove_from_lists(struct device_link *link)
> -{
> -       list_del(&link->s_node);
> -       list_del(&link->c_node);
> -}
> -#endif /* !CONFIG_SRCU */
>
>  static bool device_is_ancestor(struct device *dev, struct device *target)
>  {
> --
> 2.31.1.189.g2e36527f23
>
diff mbox series

Patch

diff --git a/drivers/base/core.c b/drivers/base/core.c
index a3e14143ec0cf..bb36aca8d1b7a 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -181,7 +181,6 @@  void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
 }
 EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
 
-#ifdef CONFIG_SRCU
 static DEFINE_MUTEX(device_links_lock);
 DEFINE_STATIC_SRCU(device_links_srcu);
 
@@ -220,47 +219,6 @@  static void device_link_remove_from_lists(struct device_link *link)
 	list_del_rcu(&link->s_node);
 	list_del_rcu(&link->c_node);
 }
-#else /* !CONFIG_SRCU */
-static DECLARE_RWSEM(device_links_lock);
-
-static inline void device_links_write_lock(void)
-{
-	down_write(&device_links_lock);
-}
-
-static inline void device_links_write_unlock(void)
-{
-	up_write(&device_links_lock);
-}
-
-int device_links_read_lock(void)
-{
-	down_read(&device_links_lock);
-	return 0;
-}
-
-void device_links_read_unlock(int not_used)
-{
-	up_read(&device_links_lock);
-}
-
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-int device_links_read_lock_held(void)
-{
-	return lockdep_is_held(&device_links_lock);
-}
-#endif
-
-static inline void device_link_synchronize_removal(void)
-{
-}
-
-static void device_link_remove_from_lists(struct device_link *link)
-{
-	list_del(&link->s_node);
-	list_del(&link->c_node);
-}
-#endif /* !CONFIG_SRCU */
 
 static bool device_is_ancestor(struct device *dev, struct device *target)
 {