From: Jeff Garzik <jeff@garzik•org>
To: Alan <alan@lxorguk•ukuu.org.uk>, benh@kernel•crashing.org
Cc: arnd@arndb•de, linuxppc-dev@ozlabs•org,
linux-ide@vger•kernel.org, paulus@samba•org
Subject: Re: [PATCH 2/4] libata-core.c: add another IRQ calls
Date: Tue, 16 Jan 2007 17:04:27 -0500 [thread overview]
Message-ID: <45AD4BEB.4070507@garzik.org> (raw)
In-Reply-To: <20070116120335.59b4491d@localhost.localdomain>
Alan wrote:
> Jeff - at some point we could eliminate a lot of the NULL checks like
> these by having the registration code fill in the defaults where
> appropriate ?
libata policy up until this point has been to require all drivers fill
in the hook, either with the commonly-used default, or with their own
variant. Thus, no NULL checks for required hooks, and you get an oops
if you fail this requirement. I like that better than defaults buried
inside libata-core, where it is easier for programmers to forget them.
But actually, it's an open question for the compiler guys whether this
case is preferred:
if (ap->ops->hook)
ap->ops->hook(foo, bar);
else
commonly_used_default(foo, bar);
or this:
ap->ops->hook(foo, bar);
With advanced branch prediction in modern CPUs, ISTR the first case may
be worth considering, even with the branch.
If the second case is preferred, then Akira should make a bombing run
through each driver, applying the patch
+ .irq_on = ata_irq_on
No NULL checks or registration code bother, in that case.
Comments welcome...
Jeff
next prev parent reply other threads:[~2007-01-16 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200701161046.l0GAk5Go019691@toshiba.co.jp>
2007-01-16 12:03 ` [PATCH 2/4] libata-core.c: add another IRQ calls Alan
2007-01-16 22:04 ` Jeff Garzik [this message]
2007-01-17 9:24 Mikael Pettersson
2007-01-17 16:49 ` Jeff Garzik
2007-01-17 20:31 ` Mikael Pettersson
2007-01-18 0:55 ` Akira Iguchi
[not found] ` <200701180055.l0I0tl6M021051@toshiba.co.jp>
2007-01-25 1:17 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-01-16 10:46 Akira Iguchi
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=45AD4BEB.4070507@garzik.org \
--to=jeff@garzik$(echo .)org \
--cc=alan@lxorguk$(echo .)ukuu.org.uk \
--cc=arnd@arndb$(echo .)de \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linux-ide@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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