Commit 6857b023 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eadf7f93
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment