tty: serial: jsm: fix two assignments in if conditions
authorAlexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de>
Tue, 15 Mar 2022 02:07:45 +0000 (03:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Mar 2022 12:15:50 +0000 (13:15 +0100)
Fixes two warnings reported of the form
"ERROR: do not use assignment in if condition"
reported by checkpatch.pl.

Signed-off-by: Alexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de>
Link: https://lore.kernel.org/r/20220315020745.15752-1-alexander.vorwerk@stud.uni-goettingen.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/jsm/jsm_neo.c
drivers/tty/serial/jsm/jsm_tty.c

index c4fd31de04b4df41c6282d01c2e35a7e4b367b59..110696cdaa1df4e78c1a3546c240731249d1144a 100644 (file)
@@ -291,7 +291,8 @@ static void neo_copy_data_from_uart_to_queue(struct jsm_channel *ch)
        ch->ch_cached_lsr = 0;
 
        /* Store how much space we have left in the queue */
-       if ((qleft = tail - head - 1) < 0)
+       qleft = tail - head - 1;
+       if (qleft < 0)
                qleft += RQUEUEMASK + 1;
 
        /*
index d74cbbbf33c62af9a870974bb78af1c072341320..cb58bdec2f43fe1e0d8d8478c810a212aad4e49e 100644 (file)
@@ -749,7 +749,8 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
        int qleft;
 
        /* Store how much space we have left in the queue */
-       if ((qleft = ch->ch_r_tail - ch->ch_r_head - 1) < 0)
+       qleft = ch->ch_r_tail - ch->ch_r_head - 1;
+       if (qleft < 0)
                qleft += RQUEUEMASK + 1;
 
        /*