diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-14 11:51:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-15 14:00:58 -0400 |
commit | e5a301ee02e53acf000bb8331587129930bc2290 (patch) | |
tree | 11cc2cf01465a136efaca0d618f5fc33ced02373 | |
parent | cbff67668d597da48f8bc48549a9630cbf968f34 (diff) |
[PATCH] serial167 __user annotations, NULL noise removal
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/char/serial167.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 461bfe0234c9..3af7f0958c5d 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c | |||
@@ -839,7 +839,7 @@ shutdown(struct cyclades_port * info) | |||
839 | local_irq_save(flags); | 839 | local_irq_save(flags); |
840 | if (info->xmit_buf){ | 840 | if (info->xmit_buf){ |
841 | free_page((unsigned long) info->xmit_buf); | 841 | free_page((unsigned long) info->xmit_buf); |
842 | info->xmit_buf = 0; | 842 | info->xmit_buf = NULL; |
843 | } | 843 | } |
844 | 844 | ||
845 | base_addr[CyCAR] = (u_char)channel; | 845 | base_addr[CyCAR] = (u_char)channel; |
@@ -1354,7 +1354,7 @@ cy_unthrottle(struct tty_struct * tty) | |||
1354 | 1354 | ||
1355 | static int | 1355 | static int |
1356 | get_serial_info(struct cyclades_port * info, | 1356 | get_serial_info(struct cyclades_port * info, |
1357 | struct serial_struct * retinfo) | 1357 | struct serial_struct __user * retinfo) |
1358 | { | 1358 | { |
1359 | struct serial_struct tmp; | 1359 | struct serial_struct tmp; |
1360 | 1360 | ||
@@ -1376,7 +1376,7 @@ get_serial_info(struct cyclades_port * info, | |||
1376 | 1376 | ||
1377 | static int | 1377 | static int |
1378 | set_serial_info(struct cyclades_port * info, | 1378 | set_serial_info(struct cyclades_port * info, |
1379 | struct serial_struct * new_info) | 1379 | struct serial_struct __user * new_info) |
1380 | { | 1380 | { |
1381 | struct serial_struct new_serial; | 1381 | struct serial_struct new_serial; |
1382 | struct cyclades_port old_info; | 1382 | struct cyclades_port old_info; |
@@ -1503,7 +1503,7 @@ send_break( struct cyclades_port * info, int duration) | |||
1503 | } /* send_break */ | 1503 | } /* send_break */ |
1504 | 1504 | ||
1505 | static int | 1505 | static int |
1506 | get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon) | 1506 | get_mon_info(struct cyclades_port * info, struct cyclades_monitor __user * mon) |
1507 | { | 1507 | { |
1508 | 1508 | ||
1509 | if (copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor))) | 1509 | if (copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor))) |
@@ -1516,7 +1516,7 @@ get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon) | |||
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | static int | 1518 | static int |
1519 | set_threshold(struct cyclades_port * info, unsigned long *arg) | 1519 | set_threshold(struct cyclades_port * info, unsigned long __user *arg) |
1520 | { | 1520 | { |
1521 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1521 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1522 | unsigned long value; | 1522 | unsigned long value; |
@@ -1533,7 +1533,7 @@ set_threshold(struct cyclades_port * info, unsigned long *arg) | |||
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | static int | 1535 | static int |
1536 | get_threshold(struct cyclades_port * info, unsigned long *value) | 1536 | get_threshold(struct cyclades_port * info, unsigned long __user *value) |
1537 | { | 1537 | { |
1538 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1538 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1539 | int channel; | 1539 | int channel; |
@@ -1546,7 +1546,7 @@ get_threshold(struct cyclades_port * info, unsigned long *value) | |||
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | static int | 1548 | static int |
1549 | set_default_threshold(struct cyclades_port * info, unsigned long *arg) | 1549 | set_default_threshold(struct cyclades_port * info, unsigned long __user *arg) |
1550 | { | 1550 | { |
1551 | unsigned long value; | 1551 | unsigned long value; |
1552 | 1552 | ||
@@ -1558,13 +1558,13 @@ set_default_threshold(struct cyclades_port * info, unsigned long *arg) | |||
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | static int | 1560 | static int |
1561 | get_default_threshold(struct cyclades_port * info, unsigned long *value) | 1561 | get_default_threshold(struct cyclades_port * info, unsigned long __user *value) |
1562 | { | 1562 | { |
1563 | return put_user(info->default_threshold,value); | 1563 | return put_user(info->default_threshold,value); |
1564 | } | 1564 | } |
1565 | 1565 | ||
1566 | static int | 1566 | static int |
1567 | set_timeout(struct cyclades_port * info, unsigned long *arg) | 1567 | set_timeout(struct cyclades_port * info, unsigned long __user *arg) |
1568 | { | 1568 | { |
1569 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1569 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1570 | int channel; | 1570 | int channel; |
@@ -1581,7 +1581,7 @@ set_timeout(struct cyclades_port * info, unsigned long *arg) | |||
1581 | } | 1581 | } |
1582 | 1582 | ||
1583 | static int | 1583 | static int |
1584 | get_timeout(struct cyclades_port * info, unsigned long *value) | 1584 | get_timeout(struct cyclades_port * info, unsigned long __user *value) |
1585 | { | 1585 | { |
1586 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1586 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1587 | int channel; | 1587 | int channel; |
@@ -1601,7 +1601,7 @@ set_default_timeout(struct cyclades_port * info, unsigned long value) | |||
1601 | } | 1601 | } |
1602 | 1602 | ||
1603 | static int | 1603 | static int |
1604 | get_default_timeout(struct cyclades_port * info, unsigned long *value) | 1604 | get_default_timeout(struct cyclades_port * info, unsigned long __user *value) |
1605 | { | 1605 | { |
1606 | return put_user(info->default_timeout,value); | 1606 | return put_user(info->default_timeout,value); |
1607 | } | 1607 | } |
@@ -1613,6 +1613,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file, | |||
1613 | unsigned long val; | 1613 | unsigned long val; |
1614 | struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; | 1614 | struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; |
1615 | int ret_val = 0; | 1615 | int ret_val = 0; |
1616 | void __user *argp = (void __user *)arg; | ||
1616 | 1617 | ||
1617 | #ifdef SERIAL_DEBUG_OTHER | 1618 | #ifdef SERIAL_DEBUG_OTHER |
1618 | printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */ | 1619 | printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */ |
@@ -1620,28 +1621,28 @@ cy_ioctl(struct tty_struct *tty, struct file * file, | |||
1620 | 1621 | ||
1621 | switch (cmd) { | 1622 | switch (cmd) { |
1622 | case CYGETMON: | 1623 | case CYGETMON: |
1623 | ret_val = get_mon_info(info, (struct cyclades_monitor *)arg); | 1624 | ret_val = get_mon_info(info, argp); |
1624 | break; | 1625 | break; |
1625 | case CYGETTHRESH: | 1626 | case CYGETTHRESH: |
1626 | ret_val = get_threshold(info, (unsigned long *)arg); | 1627 | ret_val = get_threshold(info, argp); |
1627 | break; | 1628 | break; |
1628 | case CYSETTHRESH: | 1629 | case CYSETTHRESH: |
1629 | ret_val = set_threshold(info, (unsigned long *)arg); | 1630 | ret_val = set_threshold(info, argp); |
1630 | break; | 1631 | break; |
1631 | case CYGETDEFTHRESH: | 1632 | case CYGETDEFTHRESH: |
1632 | ret_val = get_default_threshold(info, (unsigned long *)arg); | 1633 | ret_val = get_default_threshold(info, argp); |
1633 | break; | 1634 | break; |
1634 | case CYSETDEFTHRESH: | 1635 | case CYSETDEFTHRESH: |
1635 | ret_val = set_default_threshold(info, (unsigned long *)arg); | 1636 | ret_val = set_default_threshold(info, argp); |
1636 | break; | 1637 | break; |
1637 | case CYGETTIMEOUT: | 1638 | case CYGETTIMEOUT: |
1638 | ret_val = get_timeout(info, (unsigned long *)arg); | 1639 | ret_val = get_timeout(info, argp); |
1639 | break; | 1640 | break; |
1640 | case CYSETTIMEOUT: | 1641 | case CYSETTIMEOUT: |
1641 | ret_val = set_timeout(info, (unsigned long *)arg); | 1642 | ret_val = set_timeout(info, argp); |
1642 | break; | 1643 | break; |
1643 | case CYGETDEFTIMEOUT: | 1644 | case CYGETDEFTIMEOUT: |
1644 | ret_val = get_default_timeout(info, (unsigned long *)arg); | 1645 | ret_val = get_default_timeout(info, argp); |
1645 | break; | 1646 | break; |
1646 | case CYSETDEFTIMEOUT: | 1647 | case CYSETDEFTIMEOUT: |
1647 | ret_val = set_default_timeout(info, (unsigned long)arg); | 1648 | ret_val = set_default_timeout(info, (unsigned long)arg); |
@@ -1664,21 +1665,20 @@ cy_ioctl(struct tty_struct *tty, struct file * file, | |||
1664 | 1665 | ||
1665 | /* The following commands are incompletely implemented!!! */ | 1666 | /* The following commands are incompletely implemented!!! */ |
1666 | case TIOCGSOFTCAR: | 1667 | case TIOCGSOFTCAR: |
1667 | ret_val = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg); | 1668 | ret_val = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) argp); |
1668 | break; | 1669 | break; |
1669 | case TIOCSSOFTCAR: | 1670 | case TIOCSSOFTCAR: |
1670 | ret_val = get_user(val, (unsigned long *) arg); | 1671 | ret_val = get_user(val, (unsigned long __user *) argp); |
1671 | if (ret_val) | 1672 | if (ret_val) |
1672 | break; | 1673 | break; |
1673 | tty->termios->c_cflag = | 1674 | tty->termios->c_cflag = |
1674 | ((tty->termios->c_cflag & ~CLOCAL) | (val ? CLOCAL : 0)); | 1675 | ((tty->termios->c_cflag & ~CLOCAL) | (val ? CLOCAL : 0)); |
1675 | break; | 1676 | break; |
1676 | case TIOCGSERIAL: | 1677 | case TIOCGSERIAL: |
1677 | ret_val = get_serial_info(info, (struct serial_struct *) arg); | 1678 | ret_val = get_serial_info(info, argp); |
1678 | break; | 1679 | break; |
1679 | case TIOCSSERIAL: | 1680 | case TIOCSSERIAL: |
1680 | ret_val = set_serial_info(info, | 1681 | ret_val = set_serial_info(info, argp); |
1681 | (struct serial_struct *) arg); | ||
1682 | break; | 1682 | break; |
1683 | default: | 1683 | default: |
1684 | ret_val = -ENOIOCTLCMD; | 1684 | ret_val = -ENOIOCTLCMD; |
@@ -1773,7 +1773,7 @@ cy_close(struct tty_struct * tty, struct file * filp) | |||
1773 | tty->driver->flush_buffer(tty); | 1773 | tty->driver->flush_buffer(tty); |
1774 | tty_ldisc_flush(tty); | 1774 | tty_ldisc_flush(tty); |
1775 | info->event = 0; | 1775 | info->event = 0; |
1776 | info->tty = 0; | 1776 | info->tty = NULL; |
1777 | if (info->blocked_open) { | 1777 | if (info->blocked_open) { |
1778 | if (info->close_delay) { | 1778 | if (info->close_delay) { |
1779 | msleep_interruptible(jiffies_to_msecs(info->close_delay)); | 1779 | msleep_interruptible(jiffies_to_msecs(info->close_delay)); |
@@ -2250,7 +2250,7 @@ scrn[1] = '\0'; | |||
2250 | info->card = index; | 2250 | info->card = index; |
2251 | info->line = port_num; | 2251 | info->line = port_num; |
2252 | info->flags = STD_COM_FLAGS; | 2252 | info->flags = STD_COM_FLAGS; |
2253 | info->tty = 0; | 2253 | info->tty = NULL; |
2254 | info->xmit_fifo_size = 12; | 2254 | info->xmit_fifo_size = 12; |
2255 | info->cor1 = CyPARITY_NONE|Cy_8_BITS; | 2255 | info->cor1 = CyPARITY_NONE|Cy_8_BITS; |
2256 | info->cor2 = CyETC; | 2256 | info->cor2 = CyETC; |