diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2014-02-15 05:59:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-15 15:16:21 -0500 |
commit | 0fd927f578e96fe56f1acbfe97e6c71e6c3a4b11 (patch) | |
tree | 11f74d430ba22dc804b26132d095835fa83dab15 | |
parent | b2b2d6067db89afac3185de6e869766aa259731d (diff) |
serial: max310x: Fix sparse warnings
sparse warnings: (new ones prefixed by >>)
>> drivers/tty/serial/max310x.c:906:45: sparse: incorrect type in argument 2 (different address spaces)
drivers/tty/serial/max310x.c:906:45: expected void const [noderef] <asn:1>*from
drivers/tty/serial/max310x.c:906:45: got struct serial_rs485 *<noident>
>> drivers/tty/serial/max310x.c:938:35: sparse: incorrect type in argument 1 (different address spaces)
drivers/tty/serial/max310x.c:938:35: expected void [noderef] <asn:1>*to
drivers/tty/serial/max310x.c:938:35: got struct serial_rs485 *<noident>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/max310x.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 5836168414e4..471dbc1e2b58 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -882,8 +882,7 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd, | |||
882 | 882 | ||
883 | switch (cmd) { | 883 | switch (cmd) { |
884 | case TIOCSRS485: | 884 | case TIOCSRS485: |
885 | if (copy_from_user(&rs485, (struct serial_rs485 *)arg, | 885 | if (copy_from_user(&rs485, (void __user *)arg, sizeof(rs485))) |
886 | sizeof(rs485))) | ||
887 | return -EFAULT; | 886 | return -EFAULT; |
888 | if (rs485.delay_rts_before_send > 0x0f || | 887 | if (rs485.delay_rts_before_send > 0x0f || |
889 | rs485.delay_rts_after_send > 0x0f) | 888 | rs485.delay_rts_after_send > 0x0f) |
@@ -914,8 +913,7 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd, | |||
914 | val = max310x_port_read(port, MAX310X_HDPIXDELAY_REG); | 913 | val = max310x_port_read(port, MAX310X_HDPIXDELAY_REG); |
915 | rs485.delay_rts_before_send = val >> 4; | 914 | rs485.delay_rts_before_send = val >> 4; |
916 | rs485.delay_rts_after_send = val & 0x0f; | 915 | rs485.delay_rts_after_send = val & 0x0f; |
917 | if (copy_to_user((struct serial_rs485 *)arg, &rs485, | 916 | if (copy_to_user((void __user *)arg, &rs485, sizeof(rs485))) |
918 | sizeof(rs485))) | ||
919 | return -EFAULT; | 917 | return -EFAULT; |
920 | return 0; | 918 | return 0; |
921 | default: | 919 | default: |