public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: fix __user annotation in radeon_info_ioctl()
@ 2026-03-11 14:21 Ben Dooks
  2026-03-11 20:51 ` Claude review: " Claude Code Review Bot
  2026-03-11 20:51 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Dooks @ 2026-03-11 14:21 UTC (permalink / raw)
  To: dri-devel, amd-gfx, alexander.deucher, christian.koenig
  Cc: linux-kernel, airlied, simona, Ben Dooks

The radeon_info_ioctl() is obviously called from an ioctl()
entry for this device, and uses copy_{to,from)_user() on
the value_ptr variable.

This is generating sparse warnings due to use lack of __user
annotation on the value_ptr, so add this to remove the
following warnings:

drivers/gpu/drm/radeon/radeon_kms.c:262:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:262:43:    expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:262:43:    got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:319:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:319:43:    expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:319:43:    got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:331:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:331:43:    expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:331:43:    got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:467:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:467:43:    expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:467:43:    got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:592:43: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:592:43:    expected void const [noderef] __user *from
drivers/gpu/drm/radeon/radeon_kms.c:592:43:    got unsigned int [usertype] *[assigned] value_ptr
drivers/gpu/drm/radeon/radeon_kms.c:609:26: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/radeon/radeon_kms.c:609:26:    expected void [noderef] __user *to
drivers/gpu/drm/radeon/radeon_kms.c:609:26:    got unsigned int [usertype] *[assigned] value_ptr

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/gpu/drm/radeon/radeon_kms.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index dc43fd790a9c..57bc60c33937 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -231,13 +231,14 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 	struct radeon_device *rdev = dev->dev_private;
 	struct drm_radeon_info *info = data;
 	struct radeon_mode_info *minfo = &rdev->mode_info;
-	uint32_t *value, value_tmp, *value_ptr, value_size;
+	uint32_t *value, value_tmp, value_size;
+	uint32_t __user *value_ptr;
 	struct ttm_resource_manager *man;
 	uint64_t value64;
 	struct drm_crtc *crtc;
 	int i, found;
 
-	value_ptr = (uint32_t *)((unsigned long)info->value);
+	value_ptr = (uint32_t __user *)((unsigned long)info->value);
 	value = &value_tmp;
 	value_size = sizeof(uint32_t);
 
-- 
2.37.2.352.g3c44437643


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Claude review: drm/radeon: fix __user annotation in radeon_info_ioctl()
  2026-03-11 14:21 [PATCH] drm/radeon: fix __user annotation in radeon_info_ioctl() Ben Dooks
  2026-03-11 20:51 ` Claude review: " Claude Code Review Bot
@ 2026-03-11 20:51 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-11 20:51 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/radeon: fix __user annotation in radeon_info_ioctl()
Author: Ben Dooks <ben.dooks@codethink.co.uk>
Patches: 1
Reviewed: 2026-03-12T06:51:40.410492

---

This is a single, straightforward patch that adds the missing `__user` annotation to the `value_ptr` variable in `radeon_info_ioctl()`. The fix is correct and complete — `value_ptr` is derived from a user-space address (`info->value`) and is exclusively used with `copy_from_user()` and `copy_to_user()`, so it should indeed carry the `__user` annotation. This is a textbook sparse warning fix with no functional change.

**Verdict: Patch looks good. No issues found.**

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Claude review: drm/radeon: fix __user annotation in radeon_info_ioctl()
  2026-03-11 14:21 [PATCH] drm/radeon: fix __user annotation in radeon_info_ioctl() Ben Dooks
@ 2026-03-11 20:51 ` Claude Code Review Bot
  2026-03-11 20:51 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-11 20:51 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status: Clean**

The patch makes two changes:

1. **Declaration split** — Separates `value_ptr` from the other `uint32_t` locals and gives it `__user`:
   ```c
   -	uint32_t *value, value_tmp, *value_ptr, value_size;
   +	uint32_t *value, value_tmp, value_size;
   +	uint32_t __user *value_ptr;
   ```

2. **Cast annotation** — Adds `__user` to the cast where `value_ptr` is assigned from `info->value`:
   ```c
   -	value_ptr = (uint32_t *)((unsigned long)info->value);
   +	value_ptr = (uint32_t __user *)((unsigned long)info->value);
   ```

Both changes are correct. `value_ptr` is used in six places in the function — five `copy_from_user()` calls and one `copy_to_user()` call — all of which expect a `__user` pointer. The fix eliminates all six sparse warnings listed in the commit message.

No functional change, no risk. Reviewed-by worthy.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-11 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 14:21 [PATCH] drm/radeon: fix __user annotation in radeon_info_ioctl() Ben Dooks
2026-03-11 20:51 ` Claude review: " Claude Code Review Bot
2026-03-11 20:51 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox