[coreboot-gerrit] Change in ...coreboot[master]: lib/fit: Normalize spaces in board names to dashes

Patrick Georgi (Code Review) gerrit at coreboot.org
Wed Dec 19 06:18:47 CET 2018


Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30173 )

Change subject: lib/fit: Normalize spaces in board names to dashes
......................................................................

lib/fit: Normalize spaces in board names to dashes

CONFIG_MAINBOARD_PART_NUMBER sometimes contains spaces, but spaces
inside compat strings aren't nice, so let's convert all spaces to
dashes.

Change-Id: I46f2b2d7091782e04df5476e50698001511f664b
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Reviewed-on: https://review.coreboot.org/c/30173
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Julius Werner <jwerner at chromium.org>
---
M src/lib/fit.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Julius Werner: Looks good to me, approved



diff --git a/src/lib/fit.c b/src/lib/fit.c
index da55072..090d34a 100644
--- a/src/lib/fit.c
+++ b/src/lib/fit.c
@@ -38,12 +38,12 @@
 	struct list_node list_node;
 };
 
-/* Convert string to lowercase and replace '_' with '-'. */
+/* Convert string to lowercase and replace '_' and spaces with '-'. */
 static char *clean_compat_string(char *str)
 {
 	for (size_t i = 0; i < strlen(str); i++) {
 		str[i] = tolower(str[i]);
-		if (str[i] == '_')
+		if (str[i] == '_' || str[i] == ' ')
 			str[i] = '-';
 	}
 

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30173
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I46f2b2d7091782e04df5476e50698001511f664b
Gerrit-Change-Number: 30173
Gerrit-PatchSet: 2
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Gerrit-Reviewer: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181219/b39a6299/attachment.html>


More information about the coreboot-gerrit mailing list