lkml.org 
[lkml]   [2019]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/3] driver/core: Fix build error when SRCU and lockdep disabled
    Date
    Properly check if lockdep lock checking is disabled at config time. If
    so, then lock_is_held() is undefined so don't do any checking.

    This fix is similar to the pattern used in srcu_read_lock_held().

    Link: https://lore.kernel.org/lkml/201908080026.WSAFx14k%25lkp@intel.com/
    Fixes: c9e4d3a2fee8 ("acpi: Use built-in RCU list checking for acpi_ioremaps list")
    Reported-by: kbuild test robot <lkp@intel.com>
    Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
    ---
    This patch is based on the -rcu dev branch.

    drivers/base/core.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/drivers/base/core.c b/drivers/base/core.c
    index 32cf83d1c744..fe25cf690562 100644
    --- a/drivers/base/core.c
    +++ b/drivers/base/core.c
    @@ -99,7 +99,11 @@ void device_links_read_unlock(int not_used)

    int device_links_read_lock_held(void)
    {
    - return lock_is_held(&device_links_lock);
    +#ifdef CONFIG_DEBUG_LOCK_ALLOC
    + return lock_is_held(&(device_links_lock.dep_map));
    +#else
    + return 1;
    +#endif
    }
    #endif /* !CONFIG_SRCU */

    --
    2.23.0.rc1.153.gdeed80330f-goog
    \
     
     \ /
      Last update: 2019-08-12 00:12    [W:3.563 / U:1.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site