* [PATCH] fix warnings in new compat code for scsi
@ 2005-02-04 2:39 James Bottomley
2005-02-04 2:54 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: James Bottomley @ 2005-02-04 2:39 UTC (permalink / raw)
To: Andi Kleen; +Cc: SCSI Mailing List
I just got around to applying and testing this. I needed the attached
to get around the compile warnings it gave me on ia64
I've got to say, it doesn't look pretty to have the block layer
compat_ioctl returning long but the scsi one returning int; likewise
with the void __user *arg vs unsigned long arg.
James
===== drivers/scsi/osst.c 1.68 vs edited =====
--- 1.68/drivers/scsi/osst.c 2005-01-17 22:14:59 -06:00
+++ edited/drivers/scsi/osst.c 2005-02-03 20:16:18 -06:00
@@ -5129,7 +5129,7 @@
int ret = -ENOIOCTLCMD;
if (sdev->host->hostt->compat_ioctl) {
- ret = sdev->host->hostt->compat_ioctl(sdev, cmd_in, arg);
+ ret = sdev->host->hostt->compat_ioctl(sdev, cmd_in, (void __user *)arg);
}
return ret;
===== drivers/scsi/st.c 1.99 vs edited =====
--- 1.99/drivers/scsi/st.c 2005-01-17 21:50:09 -06:00
+++ edited/drivers/scsi/st.c 2005-02-03 20:16:29 -06:00
@@ -3427,14 +3427,14 @@
}
#ifdef CONFIG_COMPAT
-static int st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct scsi_tape *STp = file->private_data;
struct scsi_device *sdev = STp->device;
int ret = -ENOIOCTLCMD;
if (sdev->host->hostt->compat_ioctl) {
- ret = sdev->host->hostt->compat_ioctl(sdev, cmd, arg);
+ ret = sdev->host->hostt->compat_ioctl(sdev, cmd, (void __user *)arg);
}
return ret;
===== drivers/scsi/aacraid/linit.c 1.45 vs edited =====
--- 1.45/drivers/scsi/aacraid/linit.c 2005-01-18 00:58:31 -06:00
+++ edited/drivers/scsi/aacraid/linit.c 2005-02-03 20:21:16 -06:00
@@ -514,10 +514,10 @@
return ret;
}
-static long aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
+static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
{
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
- return aac_compat_do_ioctl(dev, cmd, arg);
+ return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg);
}
static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long arg)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix warnings in new compat code for scsi
2005-02-04 2:39 [PATCH] fix warnings in new compat code for scsi James Bottomley
@ 2005-02-04 2:54 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2005-02-04 2:54 UTC (permalink / raw)
To: James Bottomley; +Cc: Linus Torvalds, Andi Kleen, SCSI Mailing List
On Thu, Feb 03, 2005 at 08:39:22PM -0600, James Bottomley wrote:
> I just got around to applying and testing this. I needed the attached
> to get around the compile warnings it gave me on ia64
>
> I've got to say, it doesn't look pretty to have the block layer
> compat_ioctl returning long but the scsi one returning int; likewise
> with the void __user *arg vs unsigned long arg.
Seconded. Use of long is utter idiocy:
a) ioctl(2) is declared as int in userland headers
b) ->ioctl() returns int
c) ->compat_ioctl() is supposed to emulate ->ioctl() of 32bit
platform, for fsck sake! Even if none of the above would apply, it
would _still_ be 32bit.
And the first two reasons apply to ->unlocked_ioctl() as well. Could we
please undo that bright decision until it's too late? I can do patches
for that in by tomorrow morning...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-04 2:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-04 2:39 [PATCH] fix warnings in new compat code for scsi James Bottomley
2005-02-04 2:54 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox