[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6P189MB0568CB290411B23A176511239C959@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>
Date: Mon, 10 Apr 2023 07:05:47 +0000
From: David Binderman <dcb314@...mail.com>
To: "Liam.Howlett@...cle.com" <Liam.Howlett@...cle.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: linux-6.3-rc6/lib/maple_tree.c: Two style issues
Hello there,
Static analyser cppcheck says:
1.
linux-6.3-rc6/lib/maple_tree.c:1951:21: style: Array index 'split' is used before limits check. [arrayIndexThenCheck]
Source code is
while (((bn->pivot[split] - min) < slot_count - 1) &&
(split < slot_count - 1) && (b_end - split > slot_min))
Suggest move limits check to before use.
2.
linux-6.3-rc6/lib/maple_tree.c:3289:11: warning: Size of pointer 'pivs' used instead of size of its data. [pointerSize]
Source code is
memset(pivs + tmp, 0,
sizeof(unsigned long *) * (max_p - tmp));
but
unsigned long *l_pivs, *pivs, gap;
Pointers and long don't have to be the same size. Suggest code rework.
Regards
David Binderman
Powered by blists - more mailing lists