pdr: pldm_entity_association_pdr_extract(): Use array notation
Stop with pointer arithmetic and make it clear what the intent of the
operations are.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ia232fd569dc603bb80998954a16e4a947e9edc4e
diff --git a/src/pdr.c b/src/pdr.c
index 6c321ad..5713216 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -1311,19 +1311,18 @@
assert(start + sizeof(struct pldm_pdr_entity_association) +
sizeof(pldm_entity) * (*num_entities - 2) ==
end);
- (*entities)->entity_type =
+ (*entities)[0].entity_type =
le16toh(entity_association_pdr->container.entity_type);
- (*entities)->entity_instance_num =
+ (*entities)[0].entity_instance_num =
le16toh(entity_association_pdr->container.entity_instance_num);
- (*entities)->entity_container_id =
+ (*entities)[0].entity_container_id =
le16toh(entity_association_pdr->container.entity_container_id);
pldm_entity *curr_entity = entity_association_pdr->children;
for (size_t i = 1; i < *num_entities; i++, curr_entity++) {
- (*entities + i)->entity_type =
- le16toh(curr_entity->entity_type);
- (*entities + i)->entity_instance_num =
+ (*entities)[i].entity_type = le16toh(curr_entity->entity_type);
+ (*entities)[i].entity_instance_num =
le16toh(curr_entity->entity_instance_num);
- (*entities + i)->entity_container_id =
+ (*entities)[i].entity_container_id =
le16toh(curr_entity->entity_container_id);
}
}