mosys: Fix YAML whitelabel logic
The logic was wrong for whitelabels and caused identities to match the
first config with correct sku instead of the correct config with both a
sku and whitelabel-tag match.
BUG=b:78274444
TEST=build and test on whitetip/santa and unit tests
Change-Id: Ib8df2f2394be7659d4440c7197fd359e7dde18d4
Reviewed-on: https://chromium-review.googlesource.com/1313534
Commit-Ready: C Shapiro <shapiroc@chromium.org>
Tested-by: C Shapiro <shapiroc@chromium.org>
Reviewed-by: Gregory Meinke <gmeinke@chromium.org>
diff --git a/lib/cros_config/cros_config_struct.c b/lib/cros_config/cros_config_struct.c
index 75ba7b0..817cb4c 100644
--- a/lib/cros_config/cros_config_struct.c
+++ b/lib/cros_config/cros_config_struct.c
@@ -63,11 +63,9 @@
bool sku_match =
(-1 == config->sku_id) || (sku_id == config->sku_id);
bool whitelabel_match =
- !*config->whitelabel_tag ||
- !strcmp(whitelabel_tag, config->whitelabel_tag);
+ !strcmp(whitelabel_tag, config->whitelabel_tag);
bool customization_match =
- !*config->customization_id ||
- !strcmp(customization_id, config->customization_id);
+ !strcmp(customization_id, config->customization_id);
if (device_match && sku_match && customization_match &&
whitelabel_match) {
intf->name = config->platform_name;