X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fsx.c;h=1ca3d2543d75ef540e404f204af982dfd06b8621;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=643163b08a8fdc7c52d05a0d205b3bc4eeb90852;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 643163b08..1ca3d2543 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -251,11 +251,13 @@ #define PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8 0x2000 #endif +#ifdef CONFIG_PCI static struct pci_device_id sx_pci_tbl[] = { { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, PCI_ANY_ID, PCI_ANY_ID }, { 0 } }; MODULE_DEVICE_TABLE(pci, sx_pci_tbl); +#endif /* CONFIG_PCI */ /* Configurable options: (Don't be too sure that it'll work if you toggle them) */ @@ -1592,7 +1594,8 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { int rc = 0; - int *descr = (int *)arg, i; + int __user *descr = (int __user *)arg; + int i; static struct sx_board *board = NULL; int nbytes, offset; unsigned long data; @@ -1668,7 +1671,7 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp, get_user (data, descr++); while (nbytes && data) { for (i=0;i nbytes) ? nbytes - i : SX_CHUNK_SIZE)) { @@ -1774,6 +1777,7 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, { int rc; struct sx_port *port = tty->driver_data; + void __user *argp = (void __user *)arg; int ival; /* func_enter2(); */ @@ -1782,24 +1786,20 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, switch (cmd) { case TIOCGSOFTCAR: rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), - (unsigned int *) arg); + (unsigned __user *) argp); break; case TIOCSSOFTCAR: - if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { + if ((rc = get_user(ival, (unsigned __user *) argp)) == 0) { tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); } break; case TIOCGSERIAL: - if ((rc = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(struct serial_struct))) == 0) - rc = gs_getserial(&port->gs, (struct serial_struct *) arg); + rc = gs_getserial(&port->gs, argp); break; case TIOCSSERIAL: - if ((rc = verify_area(VERIFY_READ, (void *) arg, - sizeof(struct serial_struct))) == 0) - rc = gs_setserial(&port->gs, (struct serial_struct *) arg); + rc = gs_setserial(&port->gs, argp); break; default: rc = -ENOIOCTLCMD;