Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3620801img; Mon, 25 Mar 2019 14:10:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIhONPRHgL46uUNnAW/mgNjbY2Xj1Ldd/uthB8YZrCDj5TPA2+TJfWQExfQR174+PJ88QK X-Received: by 2002:a17:902:2aa6:: with SMTP id j35mr27180422plb.56.1553548207906; Mon, 25 Mar 2019 14:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553548207; cv=none; d=google.com; s=arc-20160816; b=w43i1rOO2Td4WWvDGxhkM5u3iR2fR3sFsILgmTA6pPQvH+XLiI1nZLqEzbz1hy+2i3 e3zAm12CIowh7/2vPXw+QuxuL3uC1JFpNHPjj3/VCg7jBqZPihR2KvRyyG4+L86jgj7b TkL6X5TuzUPMjZ8hSKQ57fmagwFhh+NSBjZ/FZLcmrYzM162vtGOtqUiWGZRDzoTxBTM VGlzKEAs+q6ZtYAVIJAea4r7+fr80khsPhKMbGc/OXvuWa1DsEzi1Nd0MxK20hOfbOr4 IuqKrgmzap1dAwDltLc4ZfuJO5Xs3DPGwI0Te3Ll5Hvb+0dNMJW6KP/LVKizO2EgV/ht F+gg== 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 :dkim-signature; bh=jKxq5a358qtPvC2yfHbZ6xSjB+OfOwYrzq+4FrfS/wk=; b=aOZtv8UVT8lRyrE2GaFtGr3KSAVbIXg7BPcVKHICAgsMwnSJNiJuaehXFUOXPqF05Z rXlZvrsZnQ2yk1LnZsmGXEWVRlB39uHrnOyVQFU82LtyL0wxU5dRzzXDsuyw/K78T1Qp pcWgv2LSvIP/YXm0d3OxKf7w3z7mPCnvhiC3CX7/9hbV7rjHaFEBjQyg4vs3ibb+Ov87 iVLpW28n4mE/7Si8OfaaD5kXSOzaVXedF7Pkvafj3/+BMWPvtVAJ8XqgYJcPh+yVczkR cyi5oEhokY5RIw5fF3xhiOEin1OED38aiBcp2J6ajHEkT5GiZ/guCKnSq4+Mvsek+GVT cJ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DtHyCs45; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si14325611pgt.261.2019.03.25.14.09.53; Mon, 25 Mar 2019 14:10:07 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DtHyCs45; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729761AbfCYVHy (ORCPT + 99 others); Mon, 25 Mar 2019 17:07:54 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36920 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729283AbfCYVHy (ORCPT ); Mon, 25 Mar 2019 17:07:54 -0400 Received: by mail-pf1-f195.google.com with SMTP id 8so7017873pfr.4 for ; Mon, 25 Mar 2019 14:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jKxq5a358qtPvC2yfHbZ6xSjB+OfOwYrzq+4FrfS/wk=; b=DtHyCs45F9cb2dtd7Z/gHppc3S7bM0KAD6jNCy8yY+QDj4bFN4Ud9n8G1k4y7GTWB7 Nqkd+aCki5vc1zoAb5T9lfxFtvJ7coc8BrV1qls39Qnh/DBFVgIGB4tfTASq57FN728o gZ/a1elWojzTyYG0IG4DBy4NWCfo/Vczp4aq69MRWNlf3NM78LJKmRByxfi3UgPhjEku feec/eonb+BE8kELpirt5jwkSSW7vIhcX/LeKQoc0h1dKKDqefBxksvwUAyn8OCz9OZk fQbstFF2oBtvX2bAFDIYRQuOryZBp8hF6Z67iomzyZUXqyFyrUwlMNZCFLqOHC1RXRFw cXrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jKxq5a358qtPvC2yfHbZ6xSjB+OfOwYrzq+4FrfS/wk=; b=nUinwB2Ik4+ibWEwxhtSnUB30SREaEoT/ODcls3+G02+m61HzA5M9HuaFdUmWp3TYh b8de8z44f4qh7iql2qOgLctKPpC0Y7azKQHtC5IS+isw5XURDr+oxk/cDOeO4NDc4LFT Vvhssl5k3YgE7KPFNtnYKniQgl1lbZhG+yUhzCnw5vK5fCIw1Hq9jFr1VKJHPRtGvJxL TtDcL9G3m4OMgRX2+dxQkpjRGTxU1xz89dOBRByWtU5CAJQMcKju9Xn0ij7MKcwwv9SE 30DqX+u2SEwPr2sBqNYlgIbpIVr2UlUkKuDgeelueWWUfdURuYZ0AxzLpqUsuJCtjQKR wRZg== X-Gm-Message-State: APjAAAUVxnI61eJVVhyWWpBSwAVfwQLCfv3NCLKZ5Va4gUlfUvtZge8Q Ri4t0Jz6FEyUX6m1hsdfXVM= X-Received: by 2002:a63:cc03:: with SMTP id x3mr25022440pgf.121.1553548073033; Mon, 25 Mar 2019 14:07:53 -0700 (PDT) Received: from localhost ([169.229.22.206]) by smtp.gmail.com with ESMTPSA id i126sm23958484pfc.101.2019.03.25.14.07.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 14:07:52 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov To: Andrew Morton , Andy Shevchenko , Rasmus Villemoes , Arnd Bergmann , Kees Cook , Matthew Wilcox , Tetsuo Handa Cc: Yury Norov , Yury Norov , linux-kernel@vger.kernel.org Subject: [PATCH v2 RESEND 0/6] lib: rework bitmap_parselist and tests Date: Tue, 26 Mar 2019 00:07:42 +0300 Message-Id: <20190325210748.6571-1-ynorov@marvell.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 bitmap_parselist has been evolved from a pretty simple idea for long and now lacks for refactoring. It is not structured, has nested loops and a set of opaque-named variables. Things are more complicated than they may be because bitmap_parselist() is a part of user interface, and its behavior should not change. In this patchset - __bitmap_parselist() is reworked (patches 2 and 3); - time measurement in test_bitmap_parselist switched to ktime_get (patch 4); - new tests introduced (patch 5), and - bitmap_parselist_user() testing enabled with the same testset as bitmap_parselist() (patch 6). Patches 1 and 4 are fixes and may be applied separately. v1: https://lkml.org/lkml/2018/12/23/50 v2: https://www.spinics.net/lists/kernel/msg3048976.html v2 RESEND: rebased on next-20190325 and retested. Yury Norov (6): bitmap_parselist: don't calculate length of the input string bitmap_parselist: move non-parser logic to helpers bitmap_parselist: rework input string parser lib/test_bitmap: switch test_bitmap_parselist to ktime_get() lib/test_bitmap: add testcases for bitmap_parselist lib/test_bitmap: add tests for bitmap_parselist_user lib/bitmap.c | 294 ++++++++++++++++++++++++++++++---------------- lib/test_bitmap.c | 67 +++++++++-- 2 files changed, 245 insertions(+), 116 deletions(-) -- 2.17.1