summaryrefslogtreecommitdiffstats
path: root/src/lib/fit.c
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-12-12 01:12:13 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-12-19 05:18:45 +0000
commitbbaae959bdef565ceb474b3c968aca9331594ea4 (patch)
tree40addb1075fe5a3af677fcff0f6b3d62b0777403 /src/lib/fit.c
parentdca74c16a377e8287bd3c4bbe0630a1a44343aab (diff)
downloadcoreboot-bbaae959bdef565ceb474b3c968aca9331594ea4.tar.gz
coreboot-bbaae959bdef565ceb474b3c968aca9331594ea4.tar.bz2
coreboot-bbaae959bdef565ceb474b3c968aca9331594ea4.zip
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@gmx.net> Reviewed-on: https://review.coreboot.org/c/30173 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/lib/fit.c')
-rw-r--r--src/lib/fit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/fit.c b/src/lib/fit.c
index da550723d271..090d34afd757 100644
--- a/src/lib/fit.c
+++ b/src/lib/fit.c
@@ -38,12 +38,12 @@ struct compat_string_entry {
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] = '-';
}