diff options
| author | Aditya Chari <adi25charis@gmail.com> | 2026-07-25 21:21:08 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-28 09:24:56 +0200 |
| commit | da8b3221d332d3df8b59006c81f5313504ebea2f (patch) | |
| tree | 52c6eeb7a9b8d6b4c61d2dacadc0104c620eeb89 /tools/perf/scripts/python | |
| parent | da4fa4e7aec22660a7a901a44f3cbb062a6779ff (diff) | |
greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetch
`gb_audio_gb_get_topology()` combined three separate responsibilities into
a single call: querying the topology size, allocating a buffer for it, and
fetching the topology data into that buffer. This left callers with no
way to perform any of these steps independently, and forced the kzalloc()
allocation to live inside the protocol‑layer driver rather than the
caller, as already flagged by a FIXME comment at the call site
in `audio_module.c`.
Split the function into two:
- `gb_audio_gb_get_topology_size()` – queries only the topology size
- `gb_audio_gb_get_topology()` – fetches topology data into a
caller‑supplied buffer
of a given size
Update the only caller, `gb_audio_probe()` in `audio_module.c`, to
query the size first, allocate the topology buffer itself,
then fetch the data into it, freeing the buffer via the existing
`free_topology` error path on failure. The topology size is now
stored as `size_t` and validated in the caller before allocation,
addressing the earlier TODO and FIXME comments.
This resolves both the "TODO: Split into separate calls" comment
above the original function in `audio_gb.c` and the FIXME comment
at the call site in `audio_module.c`, both of which are removed
as part of this change.
No functional change in behavior for the existing probe path.
Signed-off-by: Aditya Chari S <adi25charis@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/20260725155108.7060-1-adi25charis@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
