[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtXMjwXnRIT+YHg7@smile.fi.intel.com>
Date: Tue, 19 Jul 2022 00:11:43 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Yury Norov <yury.norov@...il.com>
Cc: linux-kernel@...r.kernel.org,
Alexander Lobakin <alexandr.lobakin@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
Alexey Klimov <aklimov@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrii Nakryiko <andrii@...nel.org>,
Ben Segall <bsegall@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Dan Williams <dan.j.williams@...el.com>,
Daniel Borkmann <daniel@...earbox.net>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Dennis Zhou <dennis@...nel.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Eric Dumazet <edumazet@...gle.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
Ingo Molnar <mingo@...hat.com>,
Isabella Basso <isabbasso@...eup.net>,
John Fastabend <john.fastabend@...il.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Juergen Gross <jgross@...e.com>,
Juri Lelli <juri.lelli@...hat.com>,
KP Singh <kpsingh@...nel.org>,
Kees Cook <keescook@...omium.org>,
Martin KaFai Lau <kafai@...com>,
Mel Gorman <mgorman@...e.de>, Miroslav Benes <mbenes@...e.cz>,
Nathan Chancellor <nathan@...nel.org>,
"Paul E . McKenney" <paulmck@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Song Liu <songliubraving@...com>,
Steven Rostedt <rostedt@...dmis.org>,
Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Vlastimil Babka <vbabka@...e.cz>, Yonghong Song <yhs@...com>,
linux-mm@...ck.org, netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH 06/16] lib/test_bitmap: delete meaningless test for
bitmap_cut
On Mon, Jul 18, 2022 at 12:28:34PM -0700, Yury Norov wrote:
> One of bitmap_cut() tests passed it with:
> nbits = BITS_PER_LONG;
> first = BITS_PER_LONG;
> cut = BITS_PER_LONG;
>
> This test is useless because the range to cut is not inside the
> bitmap. This should normally raise an error, but bitmap_cut() is
> void and returns nothing.
>
> To check if the test is passed, it just tests that the memory is
> not touched by bitmap_cut(), which is probably not correct, because
> if a function is passed with wrong parameters, it's too optimistic
> to expect a correct, or even sane behavior.
>
> Now that we have bitmap_check_params(), there's a tool to detect such
> things in real code, and we can drop the test.
There are no "useless" tests. Same comments as per a couple of previous
patches.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists