linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@gmail.com>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev@ozlabs.org,
	Geoff Thorpe <Geoff.Thorpe@freescale.com>,
	smaclennan@pikatech.com
Subject: Re: [PATCH 1/2 v8] powerpc: introduce macro spin_event_timeout()
Date: Tue, 26 May 2009 15:04:50 -0400	[thread overview]
Message-ID: <9e4733910905261204p565529b0n953719f4d1c6339@mail.gmail.com> (raw)
In-Reply-To: <4A1C3230.8030009@freescale.com>

On Tue, May 26, 2009 at 2:17 PM, Timur Tabi <timur@freescale.com> wrote:
> Geoff Thorpe wrote:
>
>> rc =3D spin_event_timeout((ret =3D in_be32(x) & 0x14), ...);
>
> It's an interesting idea, but I have two problems with it:
>
> 1) This approach is that it depends on the internals of the macro. =A0Tha=
t is, you're sneaking in an assignment in the hopes that the code will beha=
ve properly. =A0You see that the current code evaluates the condition only =
once, so it works. =A0The code will look like this:
>
> 2) Unlike the wait_event_xxx macros, I believe that the actual evaluated =
expression is important to the caller. =A0So 90% of the time, the caller is=
 going to pass in "ret =3D (condition)", which means it makes more sense to=
 have this as a built-in feature of the macro.

The only time you need the result is when you are waiting on multiple
bits. I don't think looping while waiting on multiple bits is the
common case.

> So if you're okay with v9 of the patch, please ACK it.

I'll ACK ths so that I can get my driver in. But every time I used
this function I got it wrong on the first try. This is going to be a
source of bugs.


>
> --
> Timur Tabi
> Linux kernel developer at Freescale
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



--=20
Jon Smirl
jonsmirl@gmail.com

      reply	other threads:[~2009-05-26 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 19:26 [PATCH 0/2] introduce macro spin_event_timeout() Timur Tabi
2009-05-19 19:26 ` [PATCH 1/2 v8] powerpc: " Timur Tabi
2009-05-19 19:26   ` [PATCH 2/2] qe: add polling timeout to qe_issue_cmd() Timur Tabi
2009-05-19 20:10     ` Grant Likely
2009-05-19 21:09       ` Timur Tabi
2009-05-25 17:46   ` [PATCH 1/2 v8] powerpc: introduce macro spin_event_timeout() Jon Smirl
2009-05-26  3:27     ` Timur Tabi
2009-05-26 16:20       ` Geoff Thorpe
2009-05-26 16:27         ` Jon Smirl
2009-05-26 17:03         ` Timur Tabi
2009-05-26 17:56           ` Jon Smirl
2009-05-26 18:01             ` Timur Tabi
2009-05-26 18:09           ` Geoff Thorpe
2009-05-26 18:17             ` Timur Tabi
2009-05-26 19:04               ` Jon Smirl [this message]

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=9e4733910905261204p565529b0n953719f4d1c6339@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=Geoff.Thorpe@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=smaclennan@pikatech.com \
    --cc=timur@freescale.com \
    /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;
as well as URLs for NNTP newsgroup(s).