Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4302330ybg; Mon, 8 Jun 2020 04:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgCUhB5u++lDwZG45SnfGHnKMKuQhxWeXJHMYCT4gLkf8+nAjrngC1DjGy+0ZoWb574IVj X-Received: by 2002:a17:906:11d9:: with SMTP id o25mr19847376eja.377.1591616017931; Mon, 08 Jun 2020 04:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591616017; cv=none; d=google.com; s=arc-20160816; b=ZXAav5cBWf961X0QB3LFiAu5KjQnsrPs8aXMD1j6+shD4aVRBeFppbMoK6uJdsqvcG nVOBH69WDycVSuXAvwHFNvYUrqT48snUbnvkGQa5Bz3eum6UUTeuNH4T0Gr4RTuJlIAb g4LvaO515np/NLF/c5s0/yP3Q+ELl5PfMDeiKDwA4BcxQTyipPVEN5mrP6dhtgCtk6Om 2UewH1QhVHKxPTaWf58OLCinuYawQxKO1qCyIs6vtOdqiMF76kqU6VLyispv+f86z6wA V2qemRjKWW81H7zayUJZQ4FzEOdiDQRXUqh8b3SkTldc3fefNfFhHFlHaBNtjxa/UgqX TQSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9/XB7kXQLS1xVYDySLVP5Kn15kvrdx0ZXmrSl6/6z94=; b=WycgEZEDog7k+k0hhnPh9oVb06vfUwOqJkGrtm8LFlmz1jU1jyLrt53Cn3dqWPVKN8 qYrvO5qcT5uu3FIbP+mCjW+O6Dq3K2fbYpzKNB5f4YrwYNbjphakIgTRaSHmfKohF6jj Y3Lurg/TpoxdliAWfiQo5hQiLYHPgJUxwtRt8TfBKDdrY2SeCnjDYxKB4OgdTe34RXGi tNW71Cg40LqGqrCmq7aqxn7ZtrHoT0/X+kulMRDKCtXqAY9Q0jtyay+t3Dz2gPzLy/l7 GuSTYjIm1jNlbzY0G3hB+LG14WWDxoIvItpki8pPaNoHiAOzjgj5fHHTvHx5494Xs8yp eQkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KN1z/W/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si8090072ejp.594.2020.06.08.04.33.14; Mon, 08 Jun 2020 04:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KN1z/W/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729548AbgFHLbP (ORCPT + 99 others); Mon, 8 Jun 2020 07:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729310AbgFHLbO (ORCPT ); Mon, 8 Jun 2020 07:31:14 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89BC6C08C5C2 for ; Mon, 8 Jun 2020 04:31:14 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id h185so8424758pfg.2 for ; Mon, 08 Jun 2020 04:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9/XB7kXQLS1xVYDySLVP5Kn15kvrdx0ZXmrSl6/6z94=; b=KN1z/W/Ywx5Qd3mhA9Cl8XpFmYFnCTvyskPW4FRIrn+Yn+BZfB30wBzs78gsVnAZwn XVitIU30H9dY21Dg5XlUUE3tPEgVpXjRN99wIZ4mQtElKFGdZ5VFJLzNdagmb6u1o0Ng Hehj81EGCJy+3gmSBWg3S9SZB43VWSaOQNSMtVNtKZy0wDwYvIaYRhYc7ldB//e35kTu odJhhsufZU2HQS0rsmbbsRMqNYnqRI7vgJuPgpXO4wkipdlyT3C5Z71aIoMzI7Z+X6Dw 11laijqRx6T8bBGu8YaG2xBjJyl/GR4RBlhBJxpjDwqTvp9qDHZgIhCOt56T13EaelaC wQZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9/XB7kXQLS1xVYDySLVP5Kn15kvrdx0ZXmrSl6/6z94=; b=nTcMoBBayOhXpu6KpFE4zHuLuFeVOP9BFP52m7YqrX3R91dj4Mzuxo8+3O0IK7N5tX ge1afFil8u+fwhZyZAv3UugymY5ljhz0KGLdd/gxqSDF6h9UiOGpEUpaSH12WvukqZHv 8tlRluaYXCsWaFC3uacRGOi6yvbbkk1HthkGMaK1qftj2HIc0ZosbfeQ0AXsHgw3c7FE iFHJD46jUx41xwv8+WKsvN9FQDa//gSxV8Yyvv4Beegw9WXRj0SXPBDoVRYjR8yDNx5p GgxcirgjlbtokxwzihleB5PimiRquNHUdUwxenOyl959DVw9WQO9u9ZM8hiawsVUz8vB QcIw== X-Gm-Message-State: AOAM53325IbrO3ku9sF0zgWQckn8SEqw5P2i3m6+0ksffM6NsgVW5Oae B3sMl0ObxhCs92AaONTXSAN78xFNvWsEgsivdAIO9JfTQh8= X-Received: by 2002:a63:545a:: with SMTP id e26mr19504943pgm.4.1591615874015; Mon, 08 Jun 2020 04:31:14 -0700 (PDT) MIME-Version: 1.0 References: <3e3ab7a4756df2ecf8fb012f16c375d4cd714552.1591606281.git.sbrivio@redhat.com> <20200608101214.GE2428291@smile.fi.intel.com> <20200608122702.034c8c80@redhat.com> In-Reply-To: <20200608122702.034c8c80@redhat.com> From: Andy Shevchenko Date: Mon, 8 Jun 2020 14:31:02 +0300 Message-ID: Subject: Re: [PATCH 2/2] lib: Add test for bitmap_cut() To: Stefano Brivio Cc: Andy Shevchenko , Yury Norov , Andrew Morton , Rasmus Villemoes , Pablo Neira Ayuso , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 8, 2020 at 1:29 PM Stefano Brivio wrote: > On Mon, 8 Jun 2020 13:12:14 +0300 > Andy Shevchenko 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 > > > > 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: :-) > 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. -- With Best Regards, Andy Shevchenko