]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: move the check forward to avoid static check warning
authorPeng Zhang <zhangpeng.00@bytedance.com>
Mon, 20 Nov 2023 07:09:33 +0000 (15:09 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:43 +0000 (13:16 -0800)
commit98ce16bb1d2dd69d914e2a40b0b5e95a6229eda1
tree2544a3cbd1674372386752b67ee539263321437d
parent5cbb7c3df858a10c97e4cec28cda96261b2f1f22
maple_tree: move the check forward to avoid static check warning

Patch series "Some cleanups of maple tree", v2.

These are some small cleanups of maple tree.

This patch (of 5):

Put the check for gap before its reference to avoid Smatch static check
warnings.  This is not a bug, it's just a validation program.  Even with
this change, Smatch may still generate warnings because MT_BUG_ON()
doesn't necessarily stop the program.  It may require fixing Smatch itself
to avoid these warnings.

Link: https://lkml.kernel.org/r/20231120070937.35481-1-zhangpeng.00@bytedance.com
Link: https://lkml.kernel.org/r/20231120070937.35481-2-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: http://lists.infradead.org/pipermail/maple-tree/2023-November/003046.html
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c