[PATCH 11/12] vhost-vringh: use uintptr_t for address casting

Weimin Xiong <[email protected]>
Newsgroups dev.linux.lists.virtualization
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.