lib/prime_numbers: drop temporary buffer in dump_primes()
The function uses temporary buffer to convert primes bitmap into
human readable format. Switch to using kunit_info("%*pbl")", and
drop the buffer.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
master
parent
ac679a6e0f
commit
7ca1d7f939
|
|
@ -8,12 +8,10 @@
|
||||||
|
|
||||||
static void dump_primes(void *ctx, const struct primes *p)
|
static void dump_primes(void *ctx, const struct primes *p)
|
||||||
{
|
{
|
||||||
static char buf[PAGE_SIZE];
|
|
||||||
struct kunit_suite *suite = ctx;
|
struct kunit_suite *suite = ctx;
|
||||||
|
|
||||||
bitmap_print_to_pagebuf(true, buf, p->primes, p->sz);
|
kunit_info(suite, "primes.{last=%lu, .sz=%lu, .primes[]=...x%lx} = %*pbl",
|
||||||
kunit_info(suite, "primes.{last=%lu, .sz=%lu, .primes[]=...x%lx} = %s",
|
p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], (int)p->sz, p->primes);
|
||||||
p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prime_numbers_test(struct kunit *test)
|
static void prime_numbers_test(struct kunit *test)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue