mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] staging: greybus: audio: remove dead code and clean up
@ 2026-02-24 18:54 Hardik Phalet
  2026-02-24 18:54 ` [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module() Hardik Phalet
  2026-02-24 18:55 ` [PATCH v3 2/2] staging: greybus: audio: drop stale TODO comment Hardik Phalet
  0 siblings, 2 replies; 4+ messages in thread
From: Hardik Phalet @ 2026-02-24 18:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Vaibhav Agarwal
  Cc: Dan Carpenter, Mark Greer, Johan Hovold, Alex Elder, greybus-dev,
	linux-staging, linux-kernel, Hardik Phalet

This series cleans up dead code in the Greybus audio manager.

gb_audio_manager_get_module() has no in-tree callers. The previously
reported NULL dereference is therefore unreachable. Per review feedback,
the unused function is removed to avoid carrying dead code.

Patch 2 performs a small cleanup in the same area.

Changes in v3:
- Replaced the NULL-deref fix with removal of gb_audio_manager_get_module()
  since there are no in-tree callers (per Greg KH).
- No functional changes otherwise.

Thanks for the review.

Signed-off-by: Hardik Phalet <hardik.phalet@pm.me>

Hardik Phalet (2):
  staging: greybus: audio: remove unused gb_audio_manager_get_module()
  staging: greybus: audio: drop stale TODO comment

 drivers/staging/greybus/audio_manager.c        | 12 ------------
 drivers/staging/greybus/audio_manager.h        |  7 -------
 drivers/staging/greybus/audio_manager_module.c |  1 -
 3 files changed, 20 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module()
  2026-02-24 18:54 [PATCH v3 0/2] staging: greybus: audio: remove dead code and clean up Hardik Phalet
@ 2026-02-24 18:54 ` Hardik Phalet
  2026-02-25 15:04   ` Greg Kroah-Hartman
  2026-02-24 18:55 ` [PATCH v3 2/2] staging: greybus: audio: drop stale TODO comment Hardik Phalet
  1 sibling, 1 reply; 4+ messages in thread
From: Hardik Phalet @ 2026-02-24 18:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Vaibhav Agarwal
  Cc: Dan Carpenter, Mark Greer, Johan Hovold, Alex Elder, greybus-dev,
	linux-staging, linux-kernel, Hardik Phalet

gb_audio_manager_get_module() has no in-tree callers. The previously
reported NULL dereference is therefore unreachable.

Remove the unused function to avoid carrying dead code.

Signed-off-by: Hardik Phalet <hardik.phalet@pm.me>
---
 drivers/staging/greybus/audio_manager.c | 12 ------------
 drivers/staging/greybus/audio_manager.h |  7 -------
 2 files changed, 19 deletions(-)

diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c
index 27ca5f796c5f..118ada9b909b 100644
--- a/drivers/staging/greybus/audio_manager.c
+++ b/drivers/staging/greybus/audio_manager.c
@@ -105,18 +105,6 @@ void gb_audio_manager_remove_all(void)
 }
 EXPORT_SYMBOL_GPL(gb_audio_manager_remove_all);
 
-struct gb_audio_manager_module *gb_audio_manager_get_module(int id)
-{
-	struct gb_audio_manager_module *module;
-
-	down_read(&modules_rwsem);
-	module = gb_audio_manager_get_locked(id);
-	kobject_get(&module->kobj);
-	up_read(&modules_rwsem);
-	return module;
-}
-EXPORT_SYMBOL_GPL(gb_audio_manager_get_module);
-
 void gb_audio_manager_put_module(struct gb_audio_manager_module *module)
 {
 	kobject_put(&module->kobj);
diff --git a/drivers/staging/greybus/audio_manager.h b/drivers/staging/greybus/audio_manager.h
index be605485a8ce..c3ef62ee22c8 100644
--- a/drivers/staging/greybus/audio_manager.h
+++ b/drivers/staging/greybus/audio_manager.h
@@ -54,13 +54,6 @@ int gb_audio_manager_remove(int id);
  */
 void gb_audio_manager_remove_all(void);
 
-/*
- * Retrieves a gb_audio_manager_module_descriptor for the specified id.
- * Returns the gb_audio_manager_module_descriptor structure,
- * or NULL if there is no module with the specified ID.
- */
-struct gb_audio_manager_module *gb_audio_manager_get_module(int id);
-
 /*
  * Decreases the refcount of the module, obtained by the get function.
  * Modules are removed via gb_audio_manager_remove
-- 
2.53.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] staging: greybus: audio: drop stale TODO comment
  2026-02-24 18:54 [PATCH v3 0/2] staging: greybus: audio: remove dead code and clean up Hardik Phalet
  2026-02-24 18:54 ` [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module() Hardik Phalet
@ 2026-02-24 18:55 ` Hardik Phalet
  1 sibling, 0 replies; 4+ messages in thread
From: Hardik Phalet @ 2026-02-24 18:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Vaibhav Agarwal
  Cc: Dan Carpenter, Mark Greer, Johan Hovold, Alex Elder, greybus-dev,
	linux-staging, linux-kernel, Hardik Phalet

Modules are removed from modules_list in gb_audio_manager_remove() and
gb_audio_manager_remove_all() before kobject_put(). The TODO suggesting
list deletion in the kobject release callback is stale and misleading.

Signed-off-by: Hardik Phalet <hardik.phalet@pm.me>
---
 drivers/staging/greybus/audio_manager_module.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index e87b82ca6d8a..97d67989b181 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -69,7 +69,6 @@ static void gb_audio_module_release(struct kobject *kobj)
 	struct gb_audio_manager_module *module = to_gb_audio_module(kobj);
 
 	pr_info("Destroying audio module #%d\n", module->id);
-	/* TODO -> delete from list */
 	kfree(module);
 }
 
-- 
2.53.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module()
  2026-02-24 18:54 ` [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module() Hardik Phalet
@ 2026-02-25 15:04   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-25 15:04 UTC (permalink / raw)
  To: Hardik Phalet
  Cc: Vaibhav Agarwal, Dan Carpenter, Mark Greer, Johan Hovold,
	Alex Elder, greybus-dev, linux-staging, linux-kernel

On Tue, Feb 24, 2026 at 06:54:59PM +0000, Hardik Phalet wrote:
> gb_audio_manager_get_module() has no in-tree callers. The previously
> reported NULL dereference is therefore unreachable.

What "NULL dereference"?  I'll just drop this sentance from the commit
log when I apply it, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-25 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-24 18:54 [PATCH v3 0/2] staging: greybus: audio: remove dead code and clean up Hardik Phalet
2026-02-24 18:54 ` [PATCH v3 1/2] staging: greybus: audio: remove unused gb_audio_manager_get_module() Hardik Phalet
2026-02-25 15:04   ` Greg Kroah-Hartman
2026-02-24 18:55 ` [PATCH v3 2/2] staging: greybus: audio: drop stale TODO comment Hardik Phalet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®