public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@wildopensource.com>
To: roms@lpg.ticalc.org
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: your mail, [PATCH] tipar
Date: 22 Mar 2002 16:52:01 +0100	[thread overview]
Message-ID: <d31yecd2hq.fsf@lxplus052.cern.ch> (raw)
In-Reply-To: <E16lHKt-0007dn-00@the-village.bc.nu> <3C935F7A.AD380542@free.fr>

Romain Liévin <rlievin@free.fr> writes:

> Hi,
> 
> according to various remarks, I improved the source code.
> I submit it again for new comments & suggestions...

Another comment. Your usage of the START macro is kinda
broken. Basically you declare it as #define START(x) but never use the
value, and instead rely on a local scope variable named max being
present.

> +/* ----- global defines -----------------------------------------------
> */
> +
> +#define START(x) { max=jiffies+HZ/(timeout/10); }
> +#define WAIT(x)  { \
> +  if (time_before((x), jiffies)) return -1; \
> +  if (current->need_resched) schedule(); }
> +/* Try to transmit a byte on the specified port (-1 if error). */
> +static int put_ti_parallel(int minor, unsigned char data)
> +{
> +       int bit;
> +       unsigned long max;
> +       
> +       for (bit=0; bit<8; bit++) {
> +               if (data & 1) {
> +                       outbyte(2, minor);
> +                       START(max); 

If you really want to use the START macro, you should redefine it as
follows:

#define START(x) { x=jiffies+HZ/(timeout/10); }

One example of where one has to be careful with macros ;(

Jes

  parent reply	other threads:[~2002-03-22 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-13 19:21 Romain Liévin
2002-03-13 19:43 ` your mail Alan Cox
2002-03-13 20:28   ` Romain Liévin
2002-03-13 20:49     ` Richard B. Johnson
2002-03-13 22:27       ` Alan Cox
2002-03-13 22:35     ` Alan Cox
2002-03-16 15:06       ` your mail, [PATCH] tipar Romain Liévin
2002-03-16 17:46         ` Alan Cox
2002-03-31 10:39           ` [PATCH] kernel 2.5.7-pre2, tipar: TI graphing calculators Romain Liévin
2002-03-16 20:06         ` your mail, [PATCH] tipar Christoph Hellwig
2002-03-16 20:20           ` Christoph Hellwig
2002-03-17  6:16           ` Erik Andersen
2002-03-22 15:52         ` Jes Sorensen [this message]
2002-03-14  7:08 ` your mail Zwane Mwaikambo

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=d31yecd2hq.fsf@lxplus052.cern.ch \
    --to=jes@wildopensource.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roms@lpg.ticalc.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