From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: airlied@linux.ie
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH] Couple of sparse warning fixes in drivers/gpu/drm/radeon
Date: Sun, 29 Aug 2010 21:17:12 +0100 [thread overview]
Message-ID: <20100829201712.GA10562@gallifrey> (raw)
Hi,
This patch fixes a few warnings found with sparse; it should have
no functional change. The change in radeon_cs.c just removes
a variable that was being assigned but never used, along the way causing a
warning. The change in radeon_kms.c adds a couple of __user qualifiers
that cleans up some warnings and if present should have helped spot
the previously missing copy_from_user that went in previously.
Against 2.6.36-rc3
Signed-off-by: David Alan Gilbert <linux@treblig.org>
---
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index fcc79b5..f82fde7 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -120,7 +120,6 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
for (i = 0; i < p->nchunks; i++) {
struct drm_radeon_cs_chunk __user **chunk_ptr = NULL;
struct drm_radeon_cs_chunk user_chunk;
- uint32_t __user *cdata;
chunk_ptr = (void __user*)(unsigned long)p->chunks_array[i];
if (DRM_COPY_FROM_USER(&user_chunk, chunk_ptr,
@@ -144,7 +143,6 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
p->chunks[i].length_dw = user_chunk.length_dw;
p->chunks[i].user_ptr = (void __user *)(unsigned long)user_chunk.chunk_data;
- cdata = (uint32_t *)(unsigned long)user_chunk.chunk_data;
if (p->chunks[i].chunk_id != RADEON_CHUNK_ID_IB) {
size = p->chunks[i].length_dw * sizeof(uint32_t);
p->chunks[i].kdata = kmalloc(size, GFP_KERNEL);
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 5eee3c4..0559077 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -105,13 +105,13 @@ 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;
struct radeon_mode_info *minfo = &rdev->mode_info;
- uint32_t *value_ptr;
+ uint32_t __user *value_ptr;
uint32_t value;
struct drm_crtc *crtc;
int i, found;
info = data;
- value_ptr = (uint32_t *)((unsigned long)info->value);
+ value_ptr = (uint32_t __user *)((unsigned long)info->value);
if (DRM_COPY_FROM_USER(&value, value_ptr, sizeof(value)))
return -EFAULT;
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ gro.gilbert @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
reply other threads:[~2010-08-29 20:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100829201712.GA10562@gallifrey \
--to=linux@treblig.org \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox