File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -249,15 +249,12 @@ static void n_tty_check_throttle(struct tty_struct *tty)
249
249
if (ldata -> icanon && ldata -> canon_head == ldata -> read_tail )
250
250
return ;
251
251
252
- while (1 ) {
253
- int throttled ;
252
+ do {
254
253
tty_set_flow_change (tty , TTY_THROTTLE_SAFE );
255
254
if (N_TTY_BUF_SIZE - read_cnt (ldata ) >= TTY_THRESHOLD_THROTTLE )
256
255
break ;
257
- throttled = tty_throttle_safe (tty );
258
- if (!throttled )
259
- break ;
260
- }
256
+ } while (tty_throttle_safe (tty ));
257
+
261
258
__tty_set_flow_change (tty , 0 );
262
259
}
263
260
@@ -279,16 +276,14 @@ static void n_tty_check_unthrottle(struct tty_struct *tty)
279
276
* we won't get any more characters.
280
277
*/
281
278
282
- while (1 ) {
283
- int unthrottled ;
279
+ do {
284
280
tty_set_flow_change (tty , TTY_UNTHROTTLE_SAFE );
285
281
if (chars_in_buffer (tty ) > TTY_THRESHOLD_UNTHROTTLE )
286
282
break ;
283
+
287
284
n_tty_kick_worker (tty );
288
- unthrottled = tty_unthrottle_safe (tty );
289
- if (!unthrottled )
290
- break ;
291
- }
285
+ } while (tty_unthrottle_safe (tty ));
286
+
292
287
__tty_set_flow_change (tty , 0 );
293
288
}
294
289
You can’t perform that action at this time.
0 commit comments