Skip to content

Commit b0db926

Browse files
Alexander Vorwerkgregkh
authored andcommitted
tty: serial: jsm: fix two assignments in if conditions
Fixes two warnings reported of the form "ERROR: do not use assignment in if condition" reported by checkpatch.pl. Signed-off-by: Alexander Vorwerk <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 168b504 commit b0db926

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/tty/serial/jsm/jsm_neo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ static void neo_copy_data_from_uart_to_queue(struct jsm_channel *ch)
291291
ch->ch_cached_lsr = 0;
292292

293293
/* Store how much space we have left in the queue */
294-
if ((qleft = tail - head - 1) < 0)
294+
qleft = tail - head - 1;
295+
if (qleft < 0)
295296
qleft += RQUEUEMASK + 1;
296297

297298
/*

drivers/tty/serial/jsm/jsm_tty.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
749749
int qleft;
750750

751751
/* Store how much space we have left in the queue */
752-
if ((qleft = ch->ch_r_tail - ch->ch_r_head - 1) < 0)
752+
qleft = ch->ch_r_tail - ch->ch_r_head - 1;
753+
if (qleft < 0)
753754
qleft += RQUEUEMASK + 1;
754755

755756
/*

0 commit comments

Comments
 (0)