Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c118b7b authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds
Browse files

powerpc: use %*pb[l] to print bitmaps including cpumasks and nodemasks



printk and friends can now format bitmaps using '%*pb[l]'.  cpumask
and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
respectively which can be used to generate the two printf arguments
necessary to format the specified cpu/nodemask.

* Spurious if (len > 1) test dropped from shared_cpu_map_show().

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 729d8e09
Loading
Loading
Loading
Loading
+6 −9
Original line number Original line Diff line number Diff line
@@ -607,19 +607,16 @@ static ssize_t shared_cpu_map_show(struct kobject *k, struct kobj_attribute *att
{
{
	struct cache_index_dir *index;
	struct cache_index_dir *index;
	struct cache *cache;
	struct cache *cache;
	int len;
	int ret;
	int n = 0;


	index = kobj_to_cache_index_dir(k);
	index = kobj_to_cache_index_dir(k);
	cache = index->cache;
	cache = index->cache;
	len = PAGE_SIZE - 2;


	if (len > 1) {
	ret = scnprintf(buf, PAGE_SIZE - 1, "%*pb\n",
		n = cpumask_scnprintf(buf, len, &cache->shared_cpu_map);
			cpumask_pr_args(&cache->shared_cpu_map));
		buf[n++] = '\n';
	buf[ret++] = '\n';
		buf[n] = '\0';
	buf[ret] = '\0';
	}
	return ret;
	return n;
}
}


static struct kobj_attribute cache_shared_cpu_map_attr =
static struct kobj_attribute cache_shared_cpu_map_attr =
+2 −4
Original line number Original line Diff line number Diff line
@@ -131,10 +131,8 @@ static int ics_opal_set_affinity(struct irq_data *d,


	wanted_server = xics_get_irq_server(d->irq, cpumask, 1);
	wanted_server = xics_get_irq_server(d->irq, cpumask, 1);
	if (wanted_server < 0) {
	if (wanted_server < 0) {
		char cpulist[128];
		pr_warning("%s: No online cpus in the mask %*pb for irq %d\n",
		cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
			   __func__, cpumask_pr_args(cpumask), d->irq);
		pr_warning("%s: No online cpus in the mask %s for irq %d\n",
			   __func__, cpulist, d->irq);
		return -1;
		return -1;
	}
	}
	server = ics_opal_mangle_server(wanted_server);
	server = ics_opal_mangle_server(wanted_server);
+2 −5
Original line number Original line Diff line number Diff line
@@ -140,11 +140,8 @@ static int ics_rtas_set_affinity(struct irq_data *d,


	irq_server = xics_get_irq_server(d->irq, cpumask, 1);
	irq_server = xics_get_irq_server(d->irq, cpumask, 1);
	if (irq_server == -1) {
	if (irq_server == -1) {
		char cpulist[128];
		pr_warning("%s: No online cpus in the mask %*pb for irq %d\n",
		cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
			   __func__, cpumask_pr_args(cpumask), d->irq);
		printk(KERN_WARNING
			"%s: No online cpus in the mask %s for irq %d\n",
			__func__, cpulist, d->irq);
		return -1;
		return -1;
	}
	}