lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 10/30] mm/zsmalloc: Add missing annotation for migrate_read_lock()
    Date
    Sparse reports a warning at migrate_read_lock()()

    warning: context imbalance in migrate_read_lock() - wrong count at exit

    The root cause is the missing annotation at migrate_read_lock()
    Add the missing __acquires(&zspage->lock) annotation

    Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
    ---
    mm/zsmalloc.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
    index 22d17ecfe7df..da70817b4ed8 100644
    --- a/mm/zsmalloc.c
    +++ b/mm/zsmalloc.c
    @@ -1833,7 +1833,7 @@ static void migrate_lock_init(struct zspage *zspage)
    rwlock_init(&zspage->lock);
    }

    -static void migrate_read_lock(struct zspage *zspage)
    +static void migrate_read_lock(struct zspage *zspage) __acquires(&zspage->lock)
    {
    read_lock(&zspage->lock);
    }
    --
    2.24.1
    \
     
     \ /
      Last update: 2020-02-14 21:51    [W:3.804 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site