Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4314094ybg; Mon, 8 Jun 2020 04:54:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY6HwV9GgSih0gL19fNTDUHCQdEoqaeZHogqDduJeMy40rsCkoK9FcfeE8Pjok6/roRVaf X-Received: by 2002:a17:906:6c82:: with SMTP id s2mr20201846ejr.215.1591617242804; Mon, 08 Jun 2020 04:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591617242; cv=none; d=google.com; s=arc-20160816; b=y4ISDl8kf75bULbSLQovlZLPnfbC+vYPEUKHS3lLBgijoSn08pIQ+I3l8lPJl7wmVy RNM7q8HBa/r0o7WOE/8MSrP9J7ROSxb0yXhO9htbQv49pEVg0CSsfbNYE9ZjgcSTWs7D DIRlLBEd3UEl7UE/c4Jin5/ukz63r9Po2J8fG8V6D2XnPDXW/nWSKP8U0LhD3737OhE5 ajHdX0NGgxSqIUlyyYsmTd612+jQrPCPlvwfJCz/eie8FTPXnv9n786JN1aZRKOFYx/n zXy6BNeFvH4w9M7mah2vCLhu42tbxq4zgo3F+cNLlK19CIiGGKopUqmTKuhS5LVE/8sE vplg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=fnLQOqCm9fYymeAqY+q40GtLrdA7AapZIlufFwxKbYQ=; b=M7bYjCxKKeUZBawzmG+GtlpXOeFQh+htK+xBGLMa6An0tV8IbNhg0q8eHaXI4nZ872 IyKay1aOYbKIIie7NjU7MYPZnT1eAMMDxXUN7IWnKktGSQdNcqxuOFt4VLUElT69ZTh8 wUrmmqqyxx2otMIcBH/hG9ZjTZwAPnKFeC3hCncDplwzXg0AoPZmVLTk4B3hylyeMaKK BSSp3YXx1L1cyDUtSohxtrtFrPT4K4h8oXlLAHOrrv+uSmjObv1IrpfxDnilsp0YXesX WNuJIr6a9EDKRClN1zZmH2tdwS0UuPxz6KwbXbA2x3p4zJAN586Bin9Nm9j3tEKGg8Uw aJKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VDKUeP5n; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si8361703ejd.172.2020.06.08.04.53.39; Mon, 08 Jun 2020 04:54:02 -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=@redhat.com header.s=mimecast20190719 header.b=VDKUeP5n; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbgFHLvc (ORCPT + 99 others); Mon, 8 Jun 2020 07:51:32 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57561 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729568AbgFHLvb (ORCPT ); Mon, 8 Jun 2020 07:51:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591617089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fnLQOqCm9fYymeAqY+q40GtLrdA7AapZIlufFwxKbYQ=; b=VDKUeP5nqNIsA+/hE+IKj27HN0yLPsTVyh8a1wyp2ctZ0Lqx+nKYXu+qprhtEppVpL9+H6 emefCeUbWDGdJltYy9q6thIaSBnvDIenXVB6gO3gEgqg9LNgMcBNYATkdKW6mbKWHbcso0 sW3TyawGtrI8MXtuE3B+ocRau5E4+po= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-rEMiqG34PUu2h8InmVOLCQ-1; Mon, 08 Jun 2020 07:51:26 -0400 X-MC-Unique: rEMiqG34PUu2h8InmVOLCQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93900107ACCD; Mon, 8 Jun 2020 11:51:24 +0000 (UTC) Received: from elisabeth (unknown [10.36.110.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3E6B5C1C5; Mon, 8 Jun 2020 11:51:21 +0000 (UTC) Date: Mon, 8 Jun 2020 13:51:14 +0200 From: Stefano Brivio To: Andy Shevchenko Cc: Andy Shevchenko , Yury Norov , Andrew Morton , Rasmus Villemoes , Pablo Neira Ayuso , Linux Kernel Mailing List Subject: Re: [PATCH 2/2] lib: Add test for bitmap_cut() Message-ID: <20200608135114.44ae7962@elisabeth> In-Reply-To: References: <3e3ab7a4756df2ecf8fb012f16c375d4cd714552.1591606281.git.sbrivio@redhat.com> <20200608101214.GE2428291@smile.fi.intel.com> <20200608122702.034c8c80@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Jun 2020 14:31:02 +0300 Andy Shevchenko wrote: > 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: :-) 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