lkml.org 
[lkml]   [2019]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 17/23] locking/lockdep: Remove redundant argument in check_deadlock
    Date
    In check_deadlock(), the third argument read comes from the second
    argument hlock so that it can be removed. No functional change.

    Signed-off-by: Yuyang Du <duyuyang@gmail.com>
    ---
    kernel/locking/lockdep.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
    index 7bd62e2..67b6a76 100644
    --- a/kernel/locking/lockdep.c
    +++ b/kernel/locking/lockdep.c
    @@ -2241,7 +2241,7 @@ static inline void inc_chains(void)
    * Returns: 0 on deadlock detected, 1 on OK, 2 on recursive read
    */
    static int
    -check_deadlock(struct task_struct *curr, struct held_lock *next, int read)
    +check_deadlock(struct task_struct *curr, struct held_lock *next)
    {
    struct held_lock *prev;
    struct held_lock *nest = NULL;
    @@ -2260,7 +2260,7 @@ static inline void inc_chains(void)
    * Allow read-after-read recursion of the same
    * lock class (i.e. read_lock(lock)+read_lock(lock)):
    */
    - if ((read == 2) && prev->read)
    + if ((next->read == 2) && prev->read)
    return 2;

    /*
    @@ -2834,7 +2834,7 @@ static int validate_chain(struct task_struct *curr,
    * The simple case: does the current hold the same lock
    * already?
    */
    - int ret = check_deadlock(curr, hlock, hlock->read);
    + int ret = check_deadlock(curr, hlock);

    if (!ret)
    return 0;
    --
    1.8.3.1
    \
     
     \ /
      Last update: 2019-05-06 10:21    [W:6.977 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site