base: fix warnings reported by LLVM analyzer

The warnings were false positives though.
This commit is contained in:
Norman Feske
2019-01-28 14:37:17 +01:00
parent 6b289a1423
commit bcb24e316c
5 changed files with 29 additions and 17 deletions

View File

@ -41,13 +41,13 @@ void Ram_dataspace_factory::_clear_ds (Dataspace_component &ds)
{
size_t const page_rounded_size = (ds.size() + get_page_size() - 1) & get_page_mask();
enum { ONE_PAGE = 1 };
/* allocate one page in core's virtual address space */
void *virt_addr_ptr = nullptr;
if (!platform().region_alloc().alloc(get_page_size(), &virt_addr_ptr) ||
!virt_addr_ptr)
ASSERT(!"could not map 4k inside core");
if (!platform().region_alloc().alloc(get_page_size(), &virt_addr_ptr))
ASSERT_NEVER_CALLED;
if (!virt_addr_ptr)
ASSERT_NEVER_CALLED;
addr_t const virt_addr = reinterpret_cast<addr_t const>(virt_addr_ptr);
@ -55,6 +55,7 @@ void Ram_dataspace_factory::_clear_ds (Dataspace_component &ds)
for (addr_t offset = 0; offset < page_rounded_size; offset += get_page_size())
{
addr_t const phys_addr = ds.phys_addr() + offset;
enum { ONE_PAGE = 1 };
/* map one physical page to the core-local address */
if (!map_local(phys_addr, virt_addr, ONE_PAGE)) {

View File

@ -154,15 +154,16 @@ class Genode::Capability_space_sel4
bool higher(Tree_managed_data *data)
{
return data->rpc_obj_key().value() > rpc_obj_key().value();
return data->rpc_obj_key().value() > this->rpc_obj_key().value();
}
Tree_managed_data *find_by_key(Rpc_obj_key key)
{
if (key.value() == rpc_obj_key().value()) return this;
if (key.value() == this->rpc_obj_key().value())
return this;
Tree_managed_data *data =
this->child(key.value() > rpc_obj_key().value());
this->child(key.value() > this->rpc_obj_key().value());
return data ? data->find_by_key(key) : nullptr;
}