Re: [PARPORT] patch-2.2.3-tmw9


Philip Blundell (philb@gnu.org)
Sat, 20 Mar 1999 16:00:26 +0000


>> - if (!xflag || !mode) {
>> + if (mode && !xflag) {
>
>I don't think that's any better, but you're right that it's incorrect
>still. Damn C's shortcut evaluation.
>
>How about this:
>
>- if (!xflag || !mode) {
>+ if ((!mode && xflag) || (mode && !xflag)) {

The standard says (7.4.2 Unsuccessful negotiation):

        ... if the peripheral does not support the requested mode it will
        set Xflag(Select) low if Byte, ECP, or EPP Mode was requested (event
        5). [Responding with Xflag(Select) high for a request for Nibble Mode
        is not allowed since all IEEE 1284 compliant devices shall support
        Nibble Mode.]

So the code you wrote above is handling a technically illegal situation. I'm
not sure whether this is good or bad; I suspect it makes little difference.
What do you think?

p.

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Sun 28 Mar 1999 - 17:04:42 EST