Skip to contentSkip to conversation

sound: emu10k1: Replace GFP_ATOMIC with GFP_KERNEL in synth_alloc_pages

PATCH In review Jia-Ju Bai 2 participants 2 messages Jan 23, 2018 Sound

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 sound: emu10k1: Replace GFP_ATOMIC with GFP_KERNEL in synth_alloc_pages

The function synth_alloc_pages is not called in atomic context. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.

---
 sound/pci/emu10k1/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/memory.c +1 -1
index 4f1f69b..a4dbae1 100644
@@ -477,7 +477,7 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk
 			if (p)
 				__free_page(p);
 			/* try to allocate from <16MB zone */
-			p = alloc_page(GFP_ATOMIC | GFP_DMA |
+			p = alloc_page(GFP_KERNEL | GFP_DMA |
 				       __GFP_NORETRY | /* no OOM-killer */
 				       __GFP_NOWARN);
 		}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · Jia-Ju Bai

The function synth_alloc_pages is not called in atomic context. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.

---
 sound/pci/emu10k1/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I've submitted a patch last Sunday that removes this whole code anyway,
see: "[PATCH 4/5] ALSA: emu10k1: make sure synth DMA pages are allocated with DMA functions".

Maciej