On Mon, Aug 12, 2019 at 05:49:17PM -0400, Joel Fernandes (Google) wrote:
> Check if lockdep lock checking is disabled. If so, then do not define
> device_links_read_lock_held(). It is used only from places where lockdep
> checking is enabled.
> 
> Also fix a bug where I was not checking dep_map. Previously, I did not
> test !SRCU configs so this got missed. Now it is sorted.
> 
> Link: https://lore.kernel.org/lkml/201908080026.wsafx14k%[email protected]/
> Fixes: c9e4d3a2fee8 ("acpi: Use built-in RCU list checking for acpi_ioremaps 
> list")
>  (Based on RCU's dev branch)
> 
> Cc: [email protected]
> Cc: kbuild test robot <[email protected]>,
> Cc: Greg Kroah-Hartman <[email protected]>,
> Cc: Josh Triplett <[email protected]>,
> Cc: Lai Jiangshan <[email protected]>,
> Cc: [email protected],
> Cc: Mathieu Desnoyers <[email protected]>,
> Cc: "Paul E. McKenney" <[email protected]>,
> Cc: "Rafael J. Wysocki" <[email protected]>,
> Cc: [email protected],
> Cc: Steven Rostedt <[email protected]>,
> 
> Reported-by: kbuild test robot <[email protected]>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>

Nit, drop those blank lines above, should all be in one big "block">

> ---
>  drivers/base/core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 32cf83d1c744..c22271577c84 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -97,10 +97,12 @@ 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 lock_is_held(&device_links_lock);
> +     return lock_is_held(&(device_links_lock.dep_map));
>  }
> +#endif

I don't know what the original code looks like here, but I'm guessing
that some .h file will need to be fixed up as you are just preventing
this function from ever being present without that option enabled?

thanks,

greg k-h

Reply via email to