public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/8] Psmouse - add packet size
Date: Wed, 29 Sep 2004 15:38:59 +0200	[thread overview]
Message-ID: <20040929133859.GA3896@ucw.cz> (raw)
In-Reply-To: <200409290824.59004.dtor_core@ameritech.net>

On Wed, Sep 29, 2004 at 08:24:58AM -0500, Dmitry Torokhov wrote:
 
> I have been battling with myself about whether to keep them consistent
> with probe/init or make them as they are today... My issue with
> *detect returning -1 on failure is that the caller's code will look
> like:
> 
>         if (max_proto >= PSMOUSE_IMPS && !intellimouse_detect(psmouse, set_properties))
>                 return PSMOUSE_IMPS;
> 
> or 
> 
>         if (max_proto >= PSMOUSE_IMPS && intellimouse_detect(psmouse, set_properties) == 0)
>                 return PSMOUSE_IMPS;
> 
> which does not flow for me when I read the code. With pretty much every
> other function caller checks for negative and exits in case of error, it
> reads naturally as well. Here with multiple btanches I go "... and
> intellimouse is NOT detected... oh, wait, it IS detected..."

Well, yeah. I kinda got used to that reversed logic after a while.

> Oh, well. I guess I will convert them... unless I managed to presuade you
> to keep them as is ;).

Well, I understand your point, but I still think it's worth keeping the
return values consistent with the rest of the probe routines, because if
not, THEN you (or some other reader) would get used to the
positive-style returns with the protocol detection routines and
definitely understand it wrong elsewhere.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2004-09-29 13:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29  6:40 [PATCH 0/8] Set of input (psmouse) patches Dmitry Torokhov
2004-09-29  6:41 ` [PATCH 1/8] New ALPS signature Dmitry Torokhov
2004-09-29  6:42   ` [PATCH 2/8] Psmouse rate and resolution handlers Dmitry Torokhov
2004-09-29  6:43     ` [PATCH 3/8] Guest protocol switch in synaptics Dmitry Torokhov
2004-09-29  6:44       ` [PATCH 4/8] Psmouse probe fixes Dmitry Torokhov
2004-09-29  6:44         ` [PATCH 5/8] Export psmouse parameters via sysfs Dmitry Torokhov
2004-09-29  6:45           ` [PATCH 6/8] Drop PS2TPP protocol identifier Dmitry Torokhov
2004-09-29  6:46             ` [PATCH 7/8] Separate PS2PP protocol handling Dmitry Torokhov
2004-09-29  6:47               ` [PATCH 7/8] Psmouse - add packet size Dmitry Torokhov
2004-09-29  7:15                 ` Vojtech Pavlik
2004-09-29  7:29                   ` Dmitry Torokhov
2004-09-29  9:31                     ` Vojtech Pavlik
2004-09-29 13:24                       ` Dmitry Torokhov
2004-09-29 13:38                         ` Vojtech Pavlik [this message]
2004-09-30  6:43                           ` Dmitry Torokhov
2004-09-30  7:55                             ` Vojtech Pavlik
2004-09-30 10:34                             ` Jan-Benedict Glaw
2004-09-29  7:11 ` [PATCH 0/8] Set of input (psmouse) patches Vojtech Pavlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040929133859.GA3896@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox