lkml.org 
[lkml]   [2008]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dz: test after postfix decrement fails in dz_console_putchar()
On Wed, 9 Apr 2008, Johannes Weiner wrote:

> The intention was probably that this gets executed if the break in the
> loop (trdy == dport->port.line) is reached. Without your fix, this
> branch is also taken if the while-loop terminates with loops == -1
> because of the postfix dec.

You are right about the intention -- you cannot send a character to the
transmitter unless the intended line has been reported as selected for
transmission by the serial controller. Otherwise it will go to the wrong
line -- this is a serial multiplexer that selects transmission lines by
itself.

It used to be the other kind of a "while" loop. This is a cut & paste
bug -- I noticed the problem with the terminating condition of the loop
and correctly moved it to the end, but forgot to adjust the
decrementation.

> Your fix is correct but your changelog entry is wrong.

s/fails/incorrectly succeeds/

Maciej


\
 
 \ /
  Last update: 2008-04-09 16:39    [W:0.264 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site