Kernel: Specify template paramenters where they cannot be deduced

This commit is contained in:
Bananymous 2024-03-22 13:34:26 +02:00
parent 7f029b2713
commit b5aae34d86
2 changed files with 3 additions and 3 deletions

View File

@ -240,7 +240,7 @@ namespace Kernel
return BAN::Error::from_errno(ENOMEM); return BAN::Error::from_errno(ENOMEM);
auto region = BAN::UniqPtr<FramebufferMemoryRegion>::adopt(region_ptr); auto region = BAN::UniqPtr<FramebufferMemoryRegion>::adopt(region_ptr);
TRY(region->initialize({ m_vaddr, m_vaddr + BAN::Math::div_round_up(m_size, PAGE_SIZE) * PAGE_SIZE })); TRY(region->initialize({ m_vaddr, m_vaddr + BAN::Math::div_round_up<uintptr_t>(m_size, PAGE_SIZE) * PAGE_SIZE }));
return BAN::UniqPtr<MemoryRegion>(BAN::move(region)); return BAN::UniqPtr<MemoryRegion>(BAN::move(region));
} }

View File

@ -63,7 +63,7 @@ namespace Kernel
for (uint64_t i = 0; i < sector_count;) for (uint64_t i = 0; i < sector_count;)
{ {
uint16_t count = BAN::Math::min(sector_count - i, m_dma_region->size() / m_block_size); uint16_t count = BAN::Math::min<uint64_t>(sector_count - i, m_dma_region->size() / m_block_size);
NVMe::SubmissionQueueEntry sqe {}; NVMe::SubmissionQueueEntry sqe {};
sqe.opc = NVMe::OPC_IO_READ; sqe.opc = NVMe::OPC_IO_READ;
@ -90,7 +90,7 @@ namespace Kernel
for (uint64_t i = 0; i < sector_count;) for (uint64_t i = 0; i < sector_count;)
{ {
uint16_t count = BAN::Math::min(sector_count - i, m_dma_region->size() / m_block_size); uint16_t count = BAN::Math::min<uint16_t>(sector_count - i, m_dma_region->size() / m_block_size);
memcpy(reinterpret_cast<void*>(m_dma_region->vaddr()), buffer.data() + i * m_block_size, count * m_block_size); memcpy(reinterpret_cast<void*>(m_dma_region->vaddr()), buffer.data() + i * m_block_size, count * m_block_size);