Skip to contentSkip to conversation

staging: greybus: Use GFP_KERNEL for audio manager allocation

PATCH In review Torra Sowmya 2 participants 2 messages Oct 23

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: Use GFP_KERNEL for audio manager allocation

The audio manager module is created in a context that permits sleeping. Its caller, gb_audio_manager_add(), already uses GFP_KERNEL through ida_alloc(), and module creation subsequently calls kobject_init_and_add().

GFP_ATOMIC is unnecessary in this context and restricts memory reclaim. Remove the explicit flag to use the default GFP_KERNEL allocation.

---
 drivers/staging/greybus/audio_manager_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +1 -1
index dc90cc2d2308..8a9f7e7d1766 100644
@@ -187,7 +187,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module,
 	int err;
 	struct gb_audio_manager_module *m;
 
-	m = kzalloc_obj(*m, GFP_ATOMIC);
+	m = kzalloc_obj(*m);
 	if (!m)
 		return -ENOMEM;
 
Signature · 1 line
2.47.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Torra Sowmya

The audio manager module is created in a context that permits sleeping. Its caller, gb_audio_manager_add(), already uses GFP_KERNEL through ida_alloc(), and module creation subsequently calls kobject_init_and_add().

GFP_ATOMIC is unnecessary in this context and restricts memory reclaim. Remove the explicit flag to use the default GFP_KERNEL allocation.

Looks good to me.

Quoted 17 lines
---
  drivers/staging/greybus/audio_manager_module.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +1 -1
index dc90cc2d2308..8a9f7e7d1766 100644
@@ -187,7 +187,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module,
  	int err;
  	struct gb_audio_manager_module *m;
 
-	m = kzalloc_obj(*m, GFP_ATOMIC);
+	m = kzalloc_obj(*m);
  	if (!m)
  		return -ENOMEM;