}
static noinline_for_stack
-char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap,
- struct printf_spec spec, const char *fmt)
+char *bitmap_list_string(struct printf_state *ps, unsigned long *bitmap)
{
- int nr_bits = max_t(int, spec.field_width, 0);
+ int nr_bits = max_t(int, ps->spec.field_width, 0);
/* current bit is 'cur', most recently seen range is [rbot, rtop] */
int cur, rbot, rtop;
bool first = true;
+ ps->spec = default_dec_spec;
rbot = cur = find_first_bit(bitmap, nr_bits);
while (cur < nr_bits) {
rtop = cur;
continue;
if (!first) {
- if (buf < end)
- *buf = ',';
- buf++;
+ if (ps->buf < ps->end)
+ *ps->buf = ',';
+ ps->buf++;
}
first = false;
- buf = number(buf, end, rbot, default_dec_spec);
+ printf_number(ps, rbot);
if (rbot < rtop) {
- if (buf < end)
- *buf = '-';
- buf++;
+ if (ps->buf < ps->end)
+ *ps->buf = '-';
+ ps->buf++;
- buf = number(buf, end, rtop, default_dec_spec);
+ printf_number(ps, rtop);
}
rbot = cur;
}
- return buf;
+ return ps->buf;
}
static noinline_for_stack
case 'b':
switch (fmt[1]) {
case 'l':
- return bitmap_list_string(buf, end, ptr, spec, fmt);
+ return bitmap_list_string(ps, ptr);
default:
return bitmap_string(buf, end, ptr, spec, fmt);
}