Messages in this thread | | | Date | Sat, 6 Aug 2022 01:26:50 -0700 | From | Christoph Hellwig <> | Subject | Re: [PATCH] swiotlb: avoid potential left shift overflow |
| |
On Fri, Aug 05, 2022 at 07:44:38PM +0800, Chao Gao wrote: > The second operand passed to slot_addr() is declared as int or unsigned int > in all call sites. The left-shift to get the offset of a slot can overflow > if swiotlb size is larger than 4G. > > Fixes: 26a7e094783d ("swiotlb: refactor swiotlb_tbl_map_single") > Signed-off-by: Chao Gao <chao.gao@intel.com>
Can you just convert it to an inline function? That will take care of the typing in a much cleaner way than a cast.
| |