Skip to content

Commit

Permalink
platform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jorge Lopez authored and Hans de Goede committed Aug 7, 2023
1 parent efd4211 commit bfecbcb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit bfecbcb

Please sign in to comment.