printk: support and use %hh prefix
clang complains otherwise. Change-Id: I2ac98d7147ecd3d7064f17f8c9d214d44baedf97 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4717 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
@ -129,7 +129,7 @@ int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args
|
|||||||
int field_width; /* width of output field */
|
int field_width; /* width of output field */
|
||||||
int precision; /* min. # of digits for integers; max
|
int precision; /* min. # of digits for integers; max
|
||||||
number of chars for from string */
|
number of chars for from string */
|
||||||
int qualifier; /* 'h', 'l', or 'L' for integer fields */
|
int qualifier; /* 'h', 'H', 'l', or 'L' for integer fields */
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
@ -194,6 +194,10 @@ repeat:
|
|||||||
qualifier = 'L';
|
qualifier = 'L';
|
||||||
++fmt;
|
++fmt;
|
||||||
}
|
}
|
||||||
|
if (*fmt == 'h') {
|
||||||
|
qualifier = 'H';
|
||||||
|
++fmt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* default base */
|
/* default base */
|
||||||
@ -287,6 +291,10 @@ repeat:
|
|||||||
num = (unsigned short) va_arg(args, int);
|
num = (unsigned short) va_arg(args, int);
|
||||||
if (flags & SIGN)
|
if (flags & SIGN)
|
||||||
num = (short) num;
|
num = (short) num;
|
||||||
|
} else if (qualifier == 'H') {
|
||||||
|
num = (unsigned char) va_arg(args, int);
|
||||||
|
if (flags & SIGN)
|
||||||
|
num = (signed char) num;
|
||||||
} else if (flags & SIGN) {
|
} else if (flags & SIGN) {
|
||||||
num = va_arg(args, int);
|
num = va_arg(args, int);
|
||||||
} else {
|
} else {
|
||||||
|
@ -543,14 +543,14 @@ detailed_block(struct edid *out, unsigned char *x, int in_extension)
|
|||||||
static int
|
static int
|
||||||
do_checksum(unsigned char *x)
|
do_checksum(unsigned char *x)
|
||||||
{
|
{
|
||||||
printk(BIOS_SPEW, "Checksum: 0x%hx", x[0x7f]);
|
printk(BIOS_SPEW, "Checksum: 0x%hhx", x[0x7f]);
|
||||||
{
|
{
|
||||||
unsigned char sum = 0;
|
unsigned char sum = 0;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
sum += x[i];
|
sum += x[i];
|
||||||
if (sum) {
|
if (sum) {
|
||||||
printk(BIOS_SPEW, " (should be 0x%hx)", (unsigned char)(x[0x7f] - sum));
|
printk(BIOS_SPEW, " (should be 0x%hhx)", (unsigned char)(x[0x7f] - sum));
|
||||||
has_valid_checksum = 0;
|
has_valid_checksum = 0;
|
||||||
} else {
|
} else {
|
||||||
has_valid_checksum = 1;
|
has_valid_checksum = 1;
|
||||||
@ -1009,7 +1009,7 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
|
|||||||
if (edid[0x11] > 0x0f) {
|
if (edid[0x11] > 0x0f) {
|
||||||
if (edid[0x10] == 0xff) {
|
if (edid[0x10] == 0xff) {
|
||||||
has_valid_year = 1;
|
has_valid_year = 1;
|
||||||
printk(BIOS_SPEW, "Made week %hd of model year %hd\n", edid[0x10],
|
printk(BIOS_SPEW, "Made week %hhu of model year %hhu\n", edid[0x10],
|
||||||
edid[0x11]);
|
edid[0x11]);
|
||||||
out->week = edid[0x10];
|
out->week = edid[0x10];
|
||||||
out->year = edid[0x11];
|
out->year = edid[0x11];
|
||||||
@ -1017,7 +1017,7 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
|
|||||||
/* we know it's at least 2013, when this code was written */
|
/* we know it's at least 2013, when this code was written */
|
||||||
if (edid[0x11] + 90 <= 2013) {
|
if (edid[0x11] + 90 <= 2013) {
|
||||||
has_valid_year = 1;
|
has_valid_year = 1;
|
||||||
printk(BIOS_SPEW, "Made week %hd of %hd\n",
|
printk(BIOS_SPEW, "Made week %hhu of %d\n",
|
||||||
edid[0x10], edid[0x11] + 1990);
|
edid[0x10], edid[0x11] + 1990);
|
||||||
out->week = edid[0x10];
|
out->week = edid[0x10];
|
||||||
out->year = edid[0x11] + 1990;
|
out->year = edid[0x11] + 1990;
|
||||||
@ -1027,7 +1027,7 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
printk(BIOS_SPEW, "EDID version: %hd.%hd\n", edid[0x12], edid[0x13]);
|
printk(BIOS_SPEW, "EDID version: %hhu.%hhu\n", edid[0x12], edid[0x13]);
|
||||||
out->version[0] = edid[0x12];
|
out->version[0] = edid[0x12];
|
||||||
out->version[1] = edid[0x13];
|
out->version[1] = edid[0x13];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user