Re: [PATCH 2/8] vop: Cast pointers to uintptr_t

From: Joe Perches
Date: Wed Jan 16 2019 - 12:39:46 EST


On Wed, 2019-01-16 at 17:32 +0100, Vincent Whitchurch wrote:
> Fix these on 32-bit:
>
> vop_vringh.c:711:13: error: cast from pointer to integer of different
> size [-Werror=pointer-to-int-cast]
[]
> diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc/mic/vop/vop_main.c
[]
> @@ -497,7 +497,7 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
> vdev->desc = d;
> vdev->dc = (void __iomem *)d + _vop_aligned_desc_size(d);
> vdev->dnode = dnode;
> - vdev->vdev.priv = (void *)(u64)dnode;
> + vdev->vdev.priv = (void *)(uintptr_t)dnode;

trivia:

unsigned long is more commonly used in the kernel for
these casts.