Name of user not set #1002476 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
coreinfo/coreinfo.c: Support both lower and upper case alphabets
Modify handle_category_key to handle both upper and lower case alphabets in the coreinfo payload.
Change-Id: I3ccbf69e90ba7824ad6ec85d2ca59aa8f40b3006 Signed-off-by: Himanshu Sahdev himanshusah@hcl.com --- M payloads/coreinfo/coreinfo.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/35538/1
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c index b731abf..e6b7f2e 100644 --- a/payloads/coreinfo/coreinfo.c +++ b/payloads/coreinfo/coreinfo.c @@ -198,7 +198,9 @@
static void handle_category_key(struct coreinfo_cat *cat, int key) { - if (key >= 'a' && key <= 'z') { + if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) { + if (key >= 'A' && key <= 'Z') + key = key + 32; int index = key - 'a'; if (index < cat->count) { cat->cur = index;
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 1: Code-Review+1
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 1: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... File payloads/coreinfo/coreinfo.c:
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... PS1, Line 203: 32 Why this magic value?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... File payloads/coreinfo/coreinfo.c:
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... PS1, Line 203: 32
Why this magic value?
Moreover, this approach would modify 'key', which is used later on.
Here's my suggested approach:
int index; if (key >= 'A' && key <= 'Z') { index = key - 'A'; } else { index = key - 'a'; }
Hello HAOUAS Elyes, Angel Pons, Arthur Heymans, Jacob Garber, Paul Menzel, Stefan Reinauer, build bot (Jenkins), Martin Roth, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35538
to look at the new patch set (#2).
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
coreinfo/coreinfo.c: Support both lower and upper case alphabets
Modify handle_category_key to handle both upper and lower case alphabets in the coreinfo payload.
Change-Id: I3ccbf69e90ba7824ad6ec85d2ca59aa8f40b3006 Signed-off-by: Himanshu Sahdev himanshusah@hcl.com --- M payloads/coreinfo/coreinfo.c 1 file changed, 7 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/35538/2
Name of user not set #1002476 has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 2:
(1 comment)
Thanks
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... File payloads/coreinfo/coreinfo.c:
https://review.coreboot.org/c/coreboot/+/35538/1/payloads/coreinfo/coreinfo.... PS1, Line 203: 32
Moreover, this approach would modify 'key', which is used later on. […]
Yes, you are right! Done
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35538 )
Change subject: coreinfo/coreinfo.c: Support both lower and upper case alphabets ......................................................................
coreinfo/coreinfo.c: Support both lower and upper case alphabets
Modify handle_category_key to handle both upper and lower case alphabets in the coreinfo payload.
Change-Id: I3ccbf69e90ba7824ad6ec85d2ca59aa8f40b3006 Signed-off-by: Himanshu Sahdev himanshusah@hcl.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35538 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M payloads/coreinfo/coreinfo.c 1 file changed, 7 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c index b731abf..53985b2 100644 --- a/payloads/coreinfo/coreinfo.c +++ b/payloads/coreinfo/coreinfo.c @@ -198,8 +198,13 @@
static void handle_category_key(struct coreinfo_cat *cat, int key) { - if (key >= 'a' && key <= 'z') { - int index = key - 'a'; + if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) { + int index; + if (key >= 'A' && key <= 'Z') { + index = key - 'A'; + } else { + index = key - 'a'; + } if (index < cat->count) { cat->cur = index; redraw_module(cat);