Re: [PATCH] ALSA: emu10k1: macro-ize snd_emu10k1_ptr_{read,write}()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux