Implement %zu / %zd in printk
The SPI drivers from u-boot make heavy use of %zu/%zd (size_t/ssize_t). Implement this in our printk implementation so we get useful output. Change-Id: I91798ff4f28b9c3cd4db204c7ec503596d247dcd Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/1043 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
parent
56c7dc7972
commit
bfff6dea2b
|
@ -170,7 +170,7 @@ repeat:
|
||||||
|
|
||||||
/* get the conversion qualifier */
|
/* get the conversion qualifier */
|
||||||
qualifier = -1;
|
qualifier = -1;
|
||||||
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
|
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'z') {
|
||||||
qualifier = *fmt;
|
qualifier = *fmt;
|
||||||
++fmt;
|
++fmt;
|
||||||
if (*fmt == 'l') {
|
if (*fmt == 'l') {
|
||||||
|
@ -218,7 +218,6 @@ repeat:
|
||||||
field_width, precision, flags);
|
field_width, precision, flags);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
if (qualifier == 'L') {
|
if (qualifier == 'L') {
|
||||||
long long *ip = va_arg(args, long long *);
|
long long *ip = va_arg(args, long long *);
|
||||||
|
@ -265,6 +264,8 @@ repeat:
|
||||||
num = va_arg(args, unsigned long long);
|
num = va_arg(args, unsigned long long);
|
||||||
} else if (qualifier == 'l') {
|
} else if (qualifier == 'l') {
|
||||||
num = va_arg(args, unsigned long);
|
num = va_arg(args, unsigned long);
|
||||||
|
} else if (qualifier == 'z') {
|
||||||
|
num = va_arg(args, size_t);
|
||||||
} else if (qualifier == 'h') {
|
} else if (qualifier == 'h') {
|
||||||
num = (unsigned short) va_arg(args, int);
|
num = (unsigned short) va_arg(args, int);
|
||||||
if (flags & SIGN)
|
if (flags & SIGN)
|
||||||
|
|
Loading…
Reference in New Issue