diff options
author | Claire Chang <tientzu@chromium.org> | 2021-04-22 16:14:53 +0800 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2021-04-23 08:30:15 -0400 |
commit | 8d4df6f4f09cea0a55f1dbff478a9a73b3ffdeb7 (patch) | |
tree | f7330bb0dc76936d76320524d0f80c06dbe4ea4c | |
parent | 2726bf3ff2520dba61fafc90a055640f7ad54e05 (diff) | |
download | swiotlb-devel/for-linus-5.13.tar.gz |
swiotlb: Fix the type of indexdevel/for-linus-5.13
Fix the type of index from unsigned int to int since find_slots() might
return -1.
Fixes: 0774983bc923 ("swiotlb: refactor swiotlb_tbl_map_single")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Claire Chang <tientzu@chromium.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
-rw-r--r-- | kernel/dma/swiotlb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 0a5b6f7e75bce..8635a57f88e9e 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -499,7 +499,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr, { struct io_tlb_mem *mem = io_tlb_default_mem; unsigned int offset = swiotlb_align_offset(dev, orig_addr); - unsigned int index, i; + unsigned int i; + int index; phys_addr_t tlb_addr; if (!mem) |