}
static noinline_for_stack
-char *mac_address_string(char *buf, char *end, u8 *addr,
- struct printf_spec spec, const char *fmt)
+char *mac_address_string(struct printf_state *ps, u8 *addr)
{
char mac_addr[sizeof("xx:xx:xx:xx:xx:xx")];
char *p = mac_addr;
char separator;
bool reversed = false;
- switch (fmt[1]) {
+ switch (ps->fmt[1]) {
case 'F':
separator = '-';
break;
else
p = hex_byte_pack(p, addr[i]);
- if (fmt[0] == 'M' && i != 5)
+ if (ps->fmt[0] == 'M' && i != 5)
*p++ = separator;
}
*p = '\0';
- return string(buf, end, mac_addr, spec);
+ printf_string(ps, mac_addr);
+ return ps->buf;
}
static noinline_for_stack
case 'm': /* Contiguous: 000102030405 */
/* [mM]F (FDDI) */
/* [mM]R (Reverse order; Bluetooth) */
- return mac_address_string(buf, end, ptr, spec, fmt);
+ return mac_address_string(ps, ptr);
case 'I': /* Formatted IP supported
* 4: 1.2.3.4
* 6: 0001:0203:...:0708