lkml.org 
[lkml]   [2020]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] lib: Add test for bitmap_cut()
On Mon, 8 Jun 2020 14:31:02 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Mon, Jun 8, 2020 at 1:29 PM Stefano Brivio <sbrivio@redhat.com> wrote:
> > On Mon, 8 Jun 2020 13:12:14 +0300
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > > On Mon, Jun 08, 2020 at 11:13:29AM +0200, Stefano Brivio wrote:
> > > > Based on an original patch by Yury Norov: introduce a test for
> > > > bitmap_cut() that also makes sure functionality is as described for
> > > > partially overlapping src and dst.
> > >
> > > > Co-authored-by: Yury Norov <yury.norov@gmail.com>
> > >
> > > Co-developed-by (and it requires Yury's SoB as well).
> >
> > Oops, sorry, I didn't remember this part from submitting-patches.rst
> > correctly. Thanks for pointing this out.
> >
> > Yury, let me know if I should re-post with both Co-authored-by: and
>
> Co-developed-by: :-)

Grrr. That! :)

> > Signed-off-by: you -- otherwise I'll repost without both.
>
> ...
>
> > > > + if (!bitmap_equal(out, t->expected, t->nbits)) {
> > > > + pr_err("bitmap_cut failed: expected %*pb, got %*pb\n",
> > > > + t->nbits, t->expected, t->nbits, out);
> > > > + }
> > >
> > > Perhaps
> > >
> > > if (bitmap_equal(...))
> > > continue;
> > >
> > > ...
> > >
> > > ?
> >
> > That's five lines instead of four (I can't get pr_err() on one line
> > anyway) and it looks less straightforward: "if it doesn't match we have
> > an error" vs. "if it matches go to next case. We have an error". Any
> > specific reason I'm missing?
>
> Actually, please use one of suitable expect_eq_*() macro or add your
> own. Because above has an inconsistent format with the rest.

Whoops, I see now. Yes, expect_eq_bitmap() will do, I'll change this in
v2.

--
Stefano

\
 
 \ /
  Last update: 2020-06-08 13:52    [W:0.658 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site