[PATCH 12/12] vhost-vdpa: add explicit cast for void* to u64__user*

Weimin Xiong <[email protected]>
Newsgroups dev.linux.lists.virtualization
Message-ID <[email protected]>
From: xiongweimin <[email protected]>

Add explicit cast from void __user* to u64 __user* for maximum
compatibility with static analysis tools. While the implicit conversion
is valid C, explicit casts improve sparse checking compatibility.

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

diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 6ddd5f0f9..bb96b1aa5 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -779,7 +779,7 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
 	struct vhost_vdpa *v = filep->private_data;
 	struct vhost_dev *d = &v->vdev;
 	void __user *argp = (void __user *)arg;
-	u64 __user *featurep = argp;
+	u64 __user *featurep = (u64 __user *)argp;
 	u64 features;
 	long r = 0;
 
-- 
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.