diff options
author | Jorge Lopez <jorge.lopez2@hp.com> | 2023-07-31 23:31:41 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-08-07 14:35:32 +0300 |
commit | bfecbcb5713c6c602fae3b987478d135c46b4dc5 (patch) | |
tree | 7d1e2aba2ab4260816ac66263c200f901278aa95 /drivers/platform/x86/hp | |
parent | efd4211e54d1fe9c788a0506849616b41edbe7d1 (diff) | |
download | linux-bfecbcb5713c6c602fae3b987478d135c46b4dc5.tar.xz |
platform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop
Replace use of same variable in inner loop.
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-9-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/x86/hp')
-rw-r--r-- | drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 12 |
1 files changed, 5 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 3b073910b430..cffc1c9ba3e7 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -136,6 +136,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord u32 size; u32 int_value = 0; int elem; + int olist_elem; int reqs; int eloc; char *tmpstr = NULL; @@ -147,10 +148,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord if (!order_obj) return -EINVAL; - for (elem = 1, eloc = 1; elem < order_obj_count; elem++, eloc++) { - /* ONLY look at the first ORDERED_ELEM_CNT elements */ - if (eloc == ORD_ELEM_CNT) - goto exit_list; + for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT; elem++, eloc++) { switch (order_obj[elem].type) { case ACPI_TYPE_STRING: @@ -277,10 +275,10 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord tmpstr, sizeof(ordered_list_data->elements[0])); - for (elem = 1; elem < MAX_ELEMENTS_SIZE && part; elem++) { - strscpy(ordered_list_data->elements[elem], + for (olist_elem = 1; olist_elem < MAX_ELEMENTS_SIZE && part; olist_elem++) { + strscpy(ordered_list_data->elements[olist_elem], part, - sizeof(ordered_list_data->elements[elem])); + sizeof(ordered_list_data->elements[olist_elem])); part = strsep(&part_tmp, SEMICOLON_SEP); } |