Commit 7fc5b571 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds
Browse files

tools: rename bitmap_alloc() to bitmap_zalloc()

Rename bitmap_alloc() to bitmap_zalloc() in tools to follow the bitmap API
in the kernel.

No functional changes intended.

Link: https://lkml.kernel.org/r/20210814211713.180533-14-yury.norov@gmail.com


Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
Suggested-by: default avatarYury Norov <yury.norov@gmail.com>
Acked-by: default avatarYury Norov <yury.norov@gmail.com>
Tested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Alexander Lobakin <alobakin@pm.me>
Cc: Alexey Klimov <aklimov@redhat.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 44e55997
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -111,10 +111,10 @@ static inline int test_and_clear_bit(int nr, unsigned long *addr)
}

/**
 * bitmap_alloc - Allocate bitmap
 * bitmap_zalloc - Allocate bitmap
 * @nbits: Number of bits
 */
static inline unsigned long *bitmap_alloc(int nbits)
static inline unsigned long *bitmap_zalloc(int nbits)
{
	return calloc(1, BITS_TO_LONGS(nbits) * sizeof(unsigned long));
}
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ static bool asm_test_bit(long nr, const unsigned long *addr)

static int do_for_each_set_bit(unsigned int num_bits)
{
	unsigned long *to_test = bitmap_alloc(num_bits);
	unsigned long *to_test = bitmap_zalloc(num_bits);
	struct timeval start, end, diff;
	u64 runtime_us;
	struct stats fb_time_stats, tb_time_stats;
+3 −3
Original line number Diff line number Diff line
@@ -139,11 +139,11 @@ static void *c2c_he_zalloc(size_t size)
	if (!c2c_he)
		return NULL;

	c2c_he->cpuset = bitmap_alloc(c2c.cpus_cnt);
	c2c_he->cpuset = bitmap_zalloc(c2c.cpus_cnt);
	if (!c2c_he->cpuset)
		return NULL;

	c2c_he->nodeset = bitmap_alloc(c2c.nodes_cnt);
	c2c_he->nodeset = bitmap_zalloc(c2c.nodes_cnt);
	if (!c2c_he->nodeset)
		return NULL;

@@ -2047,7 +2047,7 @@ static int setup_nodes(struct perf_session *session)
		struct perf_cpu_map *map = n[node].map;
		unsigned long *set;

		set = bitmap_alloc(c2c.cpus_cnt);
		set = bitmap_zalloc(c2c.cpus_cnt);
		if (!set)
			return -ENOMEM;

+1 −1
Original line number Diff line number Diff line
@@ -2786,7 +2786,7 @@ int cmd_record(int argc, const char **argv)

	if (rec->opts.affinity != PERF_AFFINITY_SYS) {
		rec->affinity_mask.nbits = cpu__max_cpu();
		rec->affinity_mask.bits = bitmap_alloc(rec->affinity_mask.nbits);
		rec->affinity_mask.bits = bitmap_zalloc(rec->affinity_mask.nbits);
		if (!rec->affinity_mask.bits) {
			pr_err("Failed to allocate thread mask for %zd cpus\n", rec->affinity_mask.nbits);
			err = -ENOMEM;
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
	unsigned long *bm = NULL;
	int i;

	bm = bitmap_alloc(nbits);
	bm = bitmap_zalloc(nbits);

	if (map && bm) {
		for (i = 0; i < map->nr; i++)
Loading