Skip to content

Commit

Permalink
c89: move variable declaration out from the for loop
Browse files Browse the repository at this point in the history
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
  • Loading branch information
pkarashchenko committed Aug 8, 2023
1 parent 9617517 commit 263f1b3
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 154 deletions.
4 changes: 3 additions & 1 deletion drivers/net/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,15 @@ static void slip_transmit(FAR struct slip_driver_s *self)

if (self->txlen > 0)
{
int i;

/* Transmission of previous packet is still pending. This might happen
* in the 'slip_receive' -> 'slip_reply' -> 'slip_transmit' case. Try
* to forward pending packet into UART's transmit buffer. Timeout on
* packet if not forwarded within a second.
*/

for (int i = 0; (i < 10) && (self->txsent != self->txlen); )
for (i = 0; (i < 10) && (self->txsent != self->txlen); )
{
ssz = file_write(&self->tty,
&self->txbuf[self->txsent],
Expand Down
Loading

0 comments on commit 263f1b3

Please sign in to comment.