diff mbox

[2/2] compat_hdio_ioctl: Fix a declaration

Message ID 20170823222911.29453-3-bart.vanassche@wdc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bart Van Assche Aug. 23, 2017, 10:29 p.m. UTC
This patch avoids that sparse reports the following warning messages:

block/compat_ioctl.c:85:11: warning: incorrect type in assignment (different address spaces)
block/compat_ioctl.c:85:11:    expected unsigned long *[noderef] <asn:1>p
block/compat_ioctl.c:85:11:    got void [noderef] <asn:1>*
block/compat_ioctl.c:91:21: warning: incorrect type in argument 1 (different address spaces)
block/compat_ioctl.c:91:21:    expected void const volatile [noderef] <asn:1>*<noident>
block/compat_ioctl.c:91:21:    got unsigned long *[noderef] <asn:1>p
block/compat_ioctl.c:87:53: warning: dereference of noderef expression
block/compat_ioctl.c:91:21: warning: dereference of noderef expression

Fixes: commit d597580d3737 ("generic ...copy_..._user primitives")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>
---
 block/compat_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Aug. 24, 2017, 2:40 p.m. UTC | #1
On 08/23/2017 04:29 PM, Bart Van Assche wrote:
> This patch avoids that sparse reports the following warning messages:
> 
> block/compat_ioctl.c:85:11: warning: incorrect type in assignment (different address spaces)
> block/compat_ioctl.c:85:11:    expected unsigned long *[noderef] <asn:1>p
> block/compat_ioctl.c:85:11:    got void [noderef] <asn:1>*
> block/compat_ioctl.c:91:21: warning: incorrect type in argument 1 (different address spaces)
> block/compat_ioctl.c:91:21:    expected void const volatile [noderef] <asn:1>*<noident>
> block/compat_ioctl.c:91:21:    got unsigned long *[noderef] <asn:1>p
> block/compat_ioctl.c:87:53: warning: dereference of noderef expression
> block/compat_ioctl.c:91:21: warning: dereference of noderef expression

Applied for 4.14, thanks Bart.
diff mbox

Patch

diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 38554c2ea38a..abaf9d78a206 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -79,7 +79,7 @@  static int compat_hdio_getgeo(struct gendisk *disk, struct block_device *bdev,
 static int compat_hdio_ioctl(struct block_device *bdev, fmode_t mode,
 		unsigned int cmd, unsigned long arg)
 {
-	unsigned long *__user p;
+	unsigned long __user *p;
 	int error;
 
 	p = compat_alloc_user_space(sizeof(unsigned long));