Commit b972d079 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner

xfs: annotate user variables passed as void

Some argument callbacks can contain user buffers, and sparse warns
about passing them as void pointers. Cast appropriately to remove
the sparse warnings.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent e3aed1a0
...@@ -1349,7 +1349,7 @@ xfs_ioc_setxflags( ...@@ -1349,7 +1349,7 @@ xfs_ioc_setxflags(
STATIC int STATIC int
xfs_getbmap_format(void **ap, struct getbmapx *bmv, int *full) xfs_getbmap_format(void **ap, struct getbmapx *bmv, int *full)
{ {
struct getbmap __user *base = *ap; struct getbmap __user *base = (struct getbmap __user *)*ap;
/* copy only getbmap portion (not getbmapx) */ /* copy only getbmap portion (not getbmapx) */
if (copy_to_user(base, bmv, sizeof(struct getbmap))) if (copy_to_user(base, bmv, sizeof(struct getbmap)))
...@@ -1380,7 +1380,7 @@ xfs_ioc_getbmap( ...@@ -1380,7 +1380,7 @@ xfs_ioc_getbmap(
bmx.bmv_iflags |= BMV_IF_NO_DMAPI_READ; bmx.bmv_iflags |= BMV_IF_NO_DMAPI_READ;
error = xfs_getbmap(ip, &bmx, xfs_getbmap_format, error = xfs_getbmap(ip, &bmx, xfs_getbmap_format,
(struct getbmap *)arg+1); (__force struct getbmap *)arg+1);
if (error) if (error)
return error; return error;
...@@ -1393,7 +1393,7 @@ xfs_ioc_getbmap( ...@@ -1393,7 +1393,7 @@ xfs_ioc_getbmap(
STATIC int STATIC int
xfs_getbmapx_format(void **ap, struct getbmapx *bmv, int *full) xfs_getbmapx_format(void **ap, struct getbmapx *bmv, int *full)
{ {
struct getbmapx __user *base = *ap; struct getbmapx __user *base = (struct getbmapx __user *)*ap;
if (copy_to_user(base, bmv, sizeof(struct getbmapx))) if (copy_to_user(base, bmv, sizeof(struct getbmapx)))
return -EFAULT; return -EFAULT;
...@@ -1420,7 +1420,7 @@ xfs_ioc_getbmapx( ...@@ -1420,7 +1420,7 @@ xfs_ioc_getbmapx(
return -EINVAL; return -EINVAL;
error = xfs_getbmap(ip, &bmx, xfs_getbmapx_format, error = xfs_getbmap(ip, &bmx, xfs_getbmapx_format,
(struct getbmapx *)arg+1); (__force struct getbmapx *)arg+1);
if (error) if (error)
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment