summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorJorge Lopez <jorgealtxwork@gmail.com>2023-08-21 09:42:05 -0500
committerHans de Goede <hdegoede@redhat.com>2023-08-21 18:56:18 +0200
commit559eed7776c6557acf58e86c48ddaed9301550fd (patch)
tree21dea0c5e606381e8bec314755f06e6be8761799 /drivers/platform
parentfa69653f87ee3d64cfbe0c1b8190214d71745edc (diff)
platform/x86: hp-bioscfg: Update steps order list elements are evaluated
Update steps how order list elements data and elements size are evaluated. Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230821144205.13529-1-jorge.lopez2@hp.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
index cffc1c9ba3e7..1ff09dfb7d7e 100644
--- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
+++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
@@ -258,7 +258,6 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord
eloc++;
break;
case ORD_LIST_ELEMENTS:
- size = ordered_list_data->elements_size;
/*
* Ordered list data is stored in hex and comma separated format
@@ -270,17 +269,14 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord
part_tmp = tmpstr;
part = strsep(&part_tmp, COMMA_SEP);
- if (!part)
- strscpy(ordered_list_data->elements[0],
- tmpstr,
- sizeof(ordered_list_data->elements[0]));
- for (olist_elem = 1; olist_elem < MAX_ELEMENTS_SIZE && part; olist_elem++) {
+ for (olist_elem = 0; olist_elem < MAX_ELEMENTS_SIZE && part; olist_elem++) {
strscpy(ordered_list_data->elements[olist_elem],
part,
sizeof(ordered_list_data->elements[olist_elem]));
- part = strsep(&part_tmp, SEMICOLON_SEP);
+ part = strsep(&part_tmp, COMMA_SEP);
}
+ ordered_list_data->elements_size = olist_elem;
kfree(str_value);
str_value = NULL;