From: Takashi Iwai <tiwai@suse.de>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: emu10k1: macro-ize snd_emu10k1_ptr_{read,write}()
Date: Mon, 08 May 2023 13:40:14 +0200 [thread overview]
Message-ID: <874jon831d.wl-tiwai@suse.de> (raw)
In-Reply-To: <ZFjZhNtk/GWzHUiN@ugly>
On Mon, 08 May 2023 13:14:12 +0200,
Oswald Buddenhagen wrote:
>
> On Mon, May 08, 2023 at 09:14:01AM +0200, Takashi Iwai wrote:
> > Must those be macros?
> >
> yes. at least with the additional checks i've added in v2.
Hmm, it's not clear why it must be a macro. Isn't it a snd_BUG_ON()
and the check itself is non-inlined, right?
> > Not only that macro isn't really safe to use for obvious reasons,
> >
> i don't see anything obviously bad. please be specific.
It's a generic problem of a macro; you're referring the arguments that
are expanded in multiple times. At least, it could be a static
inline?
> > the expansion would cost significantly as they are called in many
> > places.
> >
> after i fixed the calls with a non-const register in v2, the code size
> increases by less than 400 bytes (with ~95 call sites). i'd say that's
> negligible.
But it's more. I'd like to know why those have to be expanded
inevitably with a macro with that cost, and if any, it should be
described.
Takashi
prev parent reply other threads:[~2023-05-08 11:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 9:59 [PATCH] ALSA: emu10k1: macro-ize snd_emu10k1_ptr_{read,write}() Oswald Buddenhagen
2023-04-28 10:32 ` Takashi Iwai
2023-05-08 7:14 ` Takashi Iwai
2023-05-08 11:14 ` Oswald Buddenhagen
2023-05-08 11:40 ` Takashi Iwai [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=874jon831d.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=oswald.buddenhagen@gmx.de \
/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