From: xiongweimin <[email protected]>

Use (void *)(uintptr_t) instead of (void *)(long) for cleaner
unsigned address handling. The uintptr_t type makes the intent clearer
that we're handling pointer-sized unsigned values.

Signed-off-by: Weimin Xiong <[email protected]>
Co-authored-by: Cursor <[email protected]>
---
 drivers/vhost/vringh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
index b4a06454f..654567ee5 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
@@ -351,7 +351,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
                                slowrange = range;
                        }
 
-                       addr = (void *)(long)(a + range.offset);
+                       addr = (void *)(uintptr_t)(a + range.offset);
                        err = move_to_indirect(vrh, &up_next, &i, addr, &desc,
                                               &descs, &desc_max);
                        if (err)
-- 
2.43.0


Reply via email to