diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-04-09 23:21:49 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-04-16 15:01:53 +0300 |
commit | 057666b69b1d51feb389a17ec73722b001aaf3d0 (patch) | |
tree | 1f00290b7dfccef07b74a656bf66d08cd13440dc /include/sound | |
parent | 0be5168047c22ad6b2fa675f02e8090b192fbc8f (diff) | |
download | linux-057666b69b1d51feb389a17ec73722b001aaf3d0.tar.xz |
ALSA: emu10k1: Reduce GFP_ATOMIC allocation
The emu10k1 fx8010 code allocates each irq resource dynamically and
links to the list at PCM trigger callback. Due to the nature of
trigger callback, the allocation is done with GFP_ATOMIC, hence it
may fail more often. Moreover, the irq resource isn't big at all, and
using the kmalloc for this won't save many bytes, either.
This patch removes the dynamic allocation and embeds the irq resource
into struct snd_emu10k1_fx8010_pcm.irq field instead of keeping a
pointer. As a result, it simplifies the code and removes the
unnecessary GFP_ATOMIC usage.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/emu10k1.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 5ebcc51c0a6a..8c1572de44c5 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -1610,7 +1610,7 @@ struct snd_emu10k1_fx8010_pcm { struct snd_pcm_indirect pcm_rec; unsigned int tram_pos; unsigned int tram_shift; - struct snd_emu10k1_fx8010_irq *irq; + struct snd_emu10k1_fx8010_irq irq; }; struct snd_emu10k1_fx8010 { @@ -1902,7 +1902,7 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu, snd_fx8010_irq_handler_t *handler, unsigned char gpr_running, void *private_data, - struct snd_emu10k1_fx8010_irq **r_irq); + struct snd_emu10k1_fx8010_irq *irq); int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, struct snd_emu10k1_fx8010_irq *irq); |