greybus: uart: Update line coding settings only when needed
authorAxel Haslam <ahaslam@baylibre.com>
Wed, 20 Apr 2016 18:47:20 +0000 (20:47 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 21 Apr 2016 01:33:47 +0000 (10:33 +0900)
The check for line coding changed should use memcmp and not memcpy.

Testing done: trivial

Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/uart.c

index c580fe0..be71891 100644 (file)
@@ -383,7 +383,7 @@ static void gb_tty_set_termios(struct tty_struct *tty,
                send_control(gb_tty, newctrl);
        }
 
-       if (memcpy(&gb_tty->line_coding, &newline, sizeof(newline))) {
+       if (memcmp(&gb_tty->line_coding, &newline, sizeof(newline))) {
                memcpy(&gb_tty->line_coding, &newline, sizeof(newline));
                send_line_coding(gb_tty);
        }