aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_mem.c
diff options
context:
space:
mode:
authorAlex Elder2021-06-09 17:35:03 -0500
committerDavid S. Miller2021-06-09 15:59:33 -0700
commit6857b02392ab89ffc4235de991b544ef22375e6e (patch)
tree10a7047a315733acc009e7de74d711fd5bfcef34 /drivers/net/ipa/ipa_mem.c
parenteadf7f9376145a2827010f1775570cfe009afc70 (diff)
net: ipa: use bitmap to check for missing regions
In ipa_mem_valid(), wait until regions have been marked in the memory region bitmap, and check all that are not found there to ensure they are not required. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_mem.c')
-rw-r--r--drivers/net/ipa/ipa_mem.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c
index 7b79aeb5f68f..ef9fdd3b8875 100644
--- a/drivers/net/ipa/ipa_mem.c
+++ b/drivers/net/ipa/ipa_mem.c
@@ -249,19 +249,16 @@ static bool ipa_mem_valid(struct ipa *ipa, const struct ipa_mem_data *mem_data)
if (mem->offset)
dev_warn(dev, "empty region %u has non-zero offset\n",
mem_id);
-
- if (ipa_mem_id_required(ipa, mem_id)) {
- dev_err(dev, "required memory region %u missing\n",
- mem_id);
- return false;
- }
}
/* Now see if any required regions are not defined */
- while (mem_id < IPA_MEM_COUNT)
- if (ipa_mem_id_required(ipa, mem_id++))
+ for (mem_id = find_first_zero_bit(regions, IPA_MEM_COUNT);
+ mem_id < IPA_MEM_COUNT;
+ mem_id = find_next_zero_bit(regions, IPA_MEM_COUNT, mem_id + 1)) {
+ if (ipa_mem_id_required(ipa, mem_id))
dev_err(dev, "required memory region %u missing\n",
mem_id);
+ }
return true;
}