Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1111161ybt; Sun, 14 Jun 2020 10:43:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJv7PaIebLG2pUlyaEusCpFvrbSYWmp6rOPHpw2WXlb+gwVtFcmOhQxhpTdTIXdkC/MIE4 X-Received: by 2002:a05:6402:36d:: with SMTP id s13mr20959467edw.192.1592156623791; Sun, 14 Jun 2020 10:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592156623; cv=none; d=google.com; s=arc-20160816; b=rfRbOnZJLFmXELFoKADdzYjbOBv09bZgkN1qAzSRCQ8ONRCGdopngeVhR30JU58AhD TC8ClrpQ7Lmtprv2KWTs4ZsnQansvn66wEyWhM+DySUmQGfgT5vOkXMVkwe58GBZ7bAI Q9PnkP/ppx8p6oDWRDpBzvhjMJq24iK9uO0hU3/la4F8x9l8bb09cd+A0x2VgXnvO8pn NKq6E9IXFs88JDh73cAqgqpY51LFHGTBrY4yFHLLgvVdt7EbDbx+FYnC4NE8uCgzfcs1 ti2jZ1k6y61BsKX7TnAhfPZSHXbDUJQzpjmRy6ZoJ4R9w3bRlrtEFKSajmDK8qYxLtgA VWXg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Zeu+4hZ5PFeY+mhbg51DL7JPlfldoxh5r8wzAPCAElM=; b=nAWiu9a+oTgxTEWlEYBMYcmeU/VZ7uykxOnyPKRLD/LEyaGqqg/PY0jY/SpovAALD6 ZRN33LKL673h71d/8Qj7Pa1AEkAENySN7Oks5YhZI4yPM/yDAtxntZfG5/omCgdYqihW ZEEL6C/qRlAI24czf5ZZKsbNGnpFNv2Khr7z7uSl5RsuiLfqebCb0U2jNCXmEAZkWdcQ RFEtg9zhx8Dd4d28h80nw8mQSe0Gu6kWKnT6iQIXGg+wWpNfTa5qtn+nR6d6YcSQtXA+ ueIhfbCCavK2+NDtYWxClxbdYYv17kxjSxIJJZi+pNTPHr5TdwKSDUrLkykvJ0FBcdlq GBxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FQNnCw1w; 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 p7si7450446ejb.303.2020.06.14.10.43.19; Sun, 14 Jun 2020 10:43:43 -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=FQNnCw1w; 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 S1726857AbgFNRl2 (ORCPT + 99 others); Sun, 14 Jun 2020 13:41:28 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49719 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbgFNRl1 (ORCPT ); Sun, 14 Jun 2020 13:41:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592156486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Zeu+4hZ5PFeY+mhbg51DL7JPlfldoxh5r8wzAPCAElM=; b=FQNnCw1wyq9kOlk4+rSfkG+VdS0C1nQR41RTLKhGatRjuiN7Im8cjfc3RLP0ALP0ybJSZV +2Myg7Fh2YM69V0vRswEYdEKEteTCsNEnFesmkuPvrnGOwYnMmNi8bswzNSsYca6JclOaX LmM7uJt7FodDItjh/9TuIrkst4qRTDo= 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-459-yswleE7LPEOFQ_UijQk1dQ-1; Sun, 14 Jun 2020 13:41:24 -0400 X-MC-Unique: yswleE7LPEOFQ_UijQk1dQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C787F64AD2; Sun, 14 Jun 2020 17:41:22 +0000 (UTC) Received: from epycfail.redhat.com (unknown [10.36.110.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40E061002396; Sun, 14 Jun 2020 17:41:19 +0000 (UTC) From: Stefano Brivio To: Andrew Morton , Andy Shevchenko Cc: Yury Norov , Rasmus Villemoes , Pablo Neira Ayuso , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] lib: Fix bitmap_cut() for overlaps, add test Date: Sun, 14 Jun 2020 19:40:52 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Patch 1/2 addresses the issue Yury reported with partially overlapping src and dst in bitmap_cut(), and 2/2 adds a test that covers basic functionality as well as this case. v2: In 2/2, use macro to verify result, drop bogus Co-Authored-by: tag, both suggested by Andy Shevchenko, and avoid stack overflow Stefano Brivio (2): bitmap: Fix bitmap_cut() for partial overlapping case bitmap: Add test for bitmap_cut() lib/bitmap.c | 4 ++-- lib/test_bitmap.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) -- 2.27.0