• Liam R. Howlett's avatar
    maple_tree: fix static analyser cppcheck issue · 5729e06c
    Liam R. Howlett authored
    Patch series "Maple tree mas_{next,prev}_range() and cleanup", v4.
    
    This patchset contains a number of clean ups to the code to make it more
    usable (next/prev range), the addition of debug output formatting, the
    addition of printing the maple state information in the WARN_ON/BUG_ON
    code.
    
    There is also work done here to keep nodes active during iterations to
    reduce the necessity of re-walking the tree.
    
    Finally, there is a new interface added to move to the next or previous
    range in the tree, even if it is empty.
    
    The organisation of the patches is as follows:
    
    0001-0004 - Small clean ups
    0005-0018 - Additional debug options and WARN_ON/BUG_ON changes
    0019      - Test module __init and __exit addition
    0020-0021 - More functional clean ups
    0022-0026 - Changes to keep nodes active
    0027-0034 - Add new mas_{prev,next}_range()
    0035      - Use new mas_{prev,next}_range() in mmap_region()
    
    
    This patch (of 35):
    
    Static analyser of the maple tree code noticed that the split variable is
    being used to dereference into an array prior to checking the variable
    itself.  Fix this issue by changing the order of the statement to check
    the variable first.
    
    Link: https://lkml.kernel.org/r/20230518145544.1722059-1-Liam.Howlett@oracle.com
    Link: https://lkml.kernel.org/r/20230518145544.1722059-2-Liam.Howlett@oracle.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
    Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
    Reviewed-by: Peng Zhang<zhangpeng.00@bytedance.com>
    Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
    Cc: Vernon Yang <vernon2gm@gmail.com>
    Cc: Wei Yang <richard.weiyang@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    5729e06c
maple_tree.c 179 KB