Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3910089imm; Mon, 18 Jun 2018 06:14:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIydJnZuYtuuFac6CAQU/Yn6gpI0cii/bmnHjgeDhp8kzK8x0H/Uelh7msEuhgXy8os/u0Q X-Received: by 2002:a62:2091:: with SMTP id m17-v6mr13383641pfj.110.1529327657058; Mon, 18 Jun 2018 06:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529327657; cv=none; d=google.com; s=arc-20160816; b=P+C0Ur3/v1neasdDx9Qzn/TFHgnV2LkNjpf0NZZQVyvKthpKEFuWQMyS/E5LkmM1ER eafMFz4SJYkKj43onFgPptAx3CGIKgmYjVc6o0x3r2lpfiJVHl0isIMexlSEX9jy5+pm qSdR7yAAc8L8YfzbH33ioU6wpAVw2R7Ursa0gGHeKr1RqJuVGZpenZqd6bb+De98HXq5 5pdorADMQwTrvxCvWtG5AmBRV/l8NgVKqYN4Ioli4jxG7uQE1OPPXoTrdidKpXLzSHbU LHYycLXo254UnNd4eNAdJmSQZ2PMTZCt3DyUUc6il4XmNu8j42T0jIKpHnz04xPdoWM/ JRVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=V0xVIZcky79bRgB9jlXvpC0ZH/K7lPax9p58qgY9umE=; b=jUW0AyvOlnfO/6QldScYPWv600uDKI1hpbNa201y/dDm+dJOO0x92XY7KWPyMmBHfy pEawTNcntMq/fprQCbWAS5u1W5LDniJLi+u2QOqR+Az2iBR3nqiXIIg5q5rXBjwZIoDy 0+LVn2ZrKjNvOf9ghvWtXexE1MIZWBMKCdWJSsYKRNTgrbUiIgDDZl2BPq9nchPYRqau Bm+H9e/+TbReryE+21te+W2gKkNJy0uYPsS4fyjyTwLRYENQh3PgAk0/Qg4m0iaxiAcw bxFNn7ftxL4QvRETno6lXolg69ZjLRzLimkJlZ5wZvpCTZpbsTZchzw1EX85ipI07KWn bicQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si12341051pgb.187.2018.06.18.06.14.02; Mon, 18 Jun 2018 06:14:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934438AbeFRNLm (ORCPT + 99 others); Mon, 18 Jun 2018 09:11:42 -0400 Received: from mga05.intel.com ([192.55.52.43]:57985 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933009AbeFRNKH (ORCPT ); Mon, 18 Jun 2018 09:10:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 06:10:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="58194695" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 18 Jun 2018 06:10:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5DECEFA; Mon, 18 Jun 2018 16:10:04 +0300 (EEST) From: Andy Shevchenko To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Andrew Morton , Yury Norov , linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, Joe Perches Cc: Andy Shevchenko Subject: [PATCH v3 0/5] bitmap: Introduce alloc/free helpers Date: Mon, 18 Jun 2018 16:09:58 +0300 Message-Id: <20180618131003.88110-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A lot of code is using allocation of bitmaps using BITS_PER_LONG() macro and sizeof(unsigned long) operator. The readability suffers because of this. The series introduces three helpers, i.e. bitmap_alloc(), bitmap_zalloc() and bitmap_free(), to make it more cleaner. Patch 1 is a preparatory to avoid namespace collisions between bitmap API and MD bitmap. No functional changes intended. Patch 2 is just orphaned from previous release cycle. Patch 3 introduces new helpers. Patches 4 and 5 is just an example how to use new helpers. Locally I have like dozen of them against different subsystems and drivers. Ideally it would go through Input subsystem, thus, needs an Ack from MD maintainer(s). Since v2: - fix compilation issue in MD bitmap code - elaborate changes in commit message of patch 5 Since v1: - added namespace fix patch against MD bitmap API - moved functions to lib/bitmap.c to avoid circular dependencies - appended Dmitry's tags Andy Shevchenko (5): md: Avoid namespace collision with bitmap API bitmap: Drop unnecessary 0 check for u32 array operations bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() Input: gpio-keys - Switch to bitmap_zalloc() Input: evdev - Switch to bitmap API drivers/input/evdev.c | 16 +- drivers/input/keyboard/gpio_keys.c | 8 +- drivers/md/dm-raid.c | 6 +- drivers/md/md-bitmap.c | 301 +++++++++--------- drivers/md/md-bitmap.h | 46 +-- drivers/md/md-cluster.c | 16 +- drivers/md/md.c | 44 +-- .../md/persistent-data/dm-space-map-common.c | 12 +- drivers/md/raid1.c | 20 +- drivers/md/raid10.c | 26 +- drivers/md/raid5-cache.c | 2 +- drivers/md/raid5.c | 24 +- include/linux/bitmap.h | 8 + lib/bitmap.c | 28 +- 14 files changed, 283 insertions(+), 274 deletions(-) -- 2.17.1