Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Alexander Vorwerk and committed by
Greg Kroah-Hartman
b0db9263 168b504b

+4 -2
+2 -1
drivers/tty/serial/jsm/jsm_neo.c
··· 291 291 ch->ch_cached_lsr = 0; 292 292 293 293 /* 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) 295 296 qleft += RQUEUEMASK + 1; 296 297 297 298 /*
+2 -1
drivers/tty/serial/jsm/jsm_tty.c
··· 749 749 int qleft; 750 750 751 751 /* 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) 753 754 qleft += RQUEUEMASK + 1; 754 755 755 756 /*