diff mbox series

drm/ttm: add __user annotation in radeon_ttm_vram_read

Message ID 20201024004706.24518-1-linux@rasmusvillemoes.dk (mailing list archive)
State New, archived
Headers show
Series drm/ttm: add __user annotation in radeon_ttm_vram_read | expand

Commit Message

Rasmus Villemoes Oct. 24, 2020, 12:47 a.m. UTC
Keep sparse happy by preserving the __user annotation when casting.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---

kernel test robot has already started spamming me due to 9c5743dff. If
I don't fix those warnings I'll keep getting those emails for
months, so let me do the easy ones.


 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König April 1, 2021, 1:09 p.m. UTC | #1
Am 24.10.20 um 02:47 schrieb Rasmus Villemoes:
> Keep sparse happy by preserving the __user annotation when casting.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Reviewed-by: Christian König <christian.koenig@amd.com>

Going over old patches and stumbled over that once.

Alex did you missed to pick it up?

Regards,
Christian.

> ---
>
> kernel test robot has already started spamming me due to 9c5743dff. If
> I don't fix those warnings I'll keep getting those emails for
> months, so let me do the easy ones.
>
>
>   drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -1005,7 +1005,7 @@ static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
>   		value = RREG32(RADEON_MM_DATA);
>   		spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
>   
> -		r = put_user(value, (uint32_t *)buf);
> +		r = put_user(value, (uint32_t __user *)buf);
>   		if (r)
>   			return r;
>
Alex Deucher April 1, 2021, 9:15 p.m. UTC | #2
Current code already contains the fix.

Alex


On Thu, Apr 1, 2021 at 9:09 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 24.10.20 um 02:47 schrieb Rasmus Villemoes:
> > Keep sparse happy by preserving the __user annotation when casting.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Going over old patches and stumbled over that once.
>
> Alex did you missed to pick it up?
>
> Regards,
> Christian.
>
> > ---
> >
> > kernel test robot has already started spamming me due to 9c5743dff. If
> > I don't fix those warnings I'll keep getting those emails for
> > months, so let me do the easy ones.
> >
> >
> >   drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> > index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644
> > --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> > +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> > @@ -1005,7 +1005,7 @@ static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
> >               value = RREG32(RADEON_MM_DATA);
> >               spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
> >
> > -             r = put_user(value, (uint32_t *)buf);
> > +             r = put_user(value, (uint32_t __user *)buf);
> >               if (r)
> >                       return r;
> >
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 36150b7f31a90aa1eece..ecfe88b0a35d8f317712 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -1005,7 +1005,7 @@  static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
 		value = RREG32(RADEON_MM_DATA);
 		spin_unlock_irqrestore(&rdev->mmio_idx_lock, flags);
 
-		r = put_user(value, (uint32_t *)buf);
+		r = put_user(value, (uint32_t __user *)buf);
 		if (r)
 			return r;