Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
console: Remove support for printing extra bases
vtxprintf() can only print numbers in base 8, 10, and 16, so the extra letters in the alphabet aren't needed.
Change-Id: I6a51c13f3298a597e801440f86bf698bdd8c736a Signed-off-by: Jacob Garber jgarber1@ualberta.ca --- M src/console/vtxprintf.c 1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/34028/1
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index 01091c8..2d4953d 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -38,7 +38,7 @@ void *data) { char c, sign, tmp[66]; - const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + const char *digits = "0123456789abcdef"; int i; int count = 0; #ifdef SUPPORT_64BIT_INTS @@ -57,11 +57,9 @@ #endif
if (type & LARGE) - digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + digits = "0123456789ABCDEF"; if (type & LEFT) type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) {
Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1:
This commit is good on its own, but most importantly shrinks the code size down ever-so-slightly so that the Smaug verstage still fits after the next commit.
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c File src/console/vtxprintf.c:
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c@a63 PS1, Line 63: Make it an assertion? `base == 8 || base == 10 || base == 16`?
Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c File src/console/vtxprintf.c:
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c@a63 PS1, Line 63:
Make it an assertion? `base == 8 || base == 10 || base == 16`?
This function is only used in this file, so I think we're pretty safe. Plus, I don't want to risk increasing the code size again :)
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c File src/console/vtxprintf.c:
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c@a63 PS1, Line 63:
This function is only used in this file, so I think we're pretty safe. […]
Assertions are only compiled on demand. And if the space is already tight, enabling them would overflow it anyway ;)
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c File src/console/vtxprintf.c:
https://review.coreboot.org/c/coreboot/+/34028/1/src/console/vtxprintf.c@a63 PS1, Line 63:
Assertions are only compiled on demand. And if the space is already […]
Hmmm, no. assert.h proves me wrong. Pretty silly, IMHO. If not with assert() how do you document a contract?
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34028 )
Change subject: console: Remove support for printing extra bases ......................................................................
console: Remove support for printing extra bases
vtxprintf() can only print numbers in base 8, 10, and 16, so the extra letters in the alphabet aren't needed.
Change-Id: I6a51c13f3298a597e801440f86bf698bdd8c736a Signed-off-by: Jacob Garber jgarber1@ualberta.ca Reviewed-on: https://review.coreboot.org/c/coreboot/+/34028 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Reviewed-by: Nico Huber nico.h@gmx.de --- M src/console/vtxprintf.c 1 file changed, 2 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index 01091c8..2d4953d 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -38,7 +38,7 @@ void *data) { char c, sign, tmp[66]; - const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + const char *digits = "0123456789abcdef"; int i; int count = 0; #ifdef SUPPORT_64BIT_INTS @@ -57,11 +57,9 @@ #endif
if (type & LARGE) - digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + digits = "0123456789ABCDEF"; if (type & LEFT) type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) {