Skip to content

audio: crossover: const-correctness, unsigned/size_t types and comp_buffer removal - #11319

Open
softwarecki wants to merge 4 commits into
thesofproject:mainfrom
softwarecki:p20-crossover
Open

softwarecki wants to merge 4 commits into
thesofproject:mainfrom
softwarecki:p20-crossover

Conversation

@softwarecki

Copy link
Copy Markdown
Collaborator

Convert prepare, the sink assignment and the IPC4 params helper to the sink/source API and drop their struct comp_buffer uses.

Change the channel-count parameters of the setup and coefficient init helpers and the channel count read in prepare from int to unsigned int.

Use source_cir_buf_wrap instead of cir_buf_wrap to advance the read-only source pointer in the processing functions.

Change the loop counter in the processing-function lookup helpers from int to size_t so it matches crossover_proc_fncount and avoids a signed/unsigned comparison.

Convert prepare, the sink assignment and the IPC4 params helper to the
sink/source API and drop their struct comp_buffer uses.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change the channel-count parameters of the setup and coefficient init
helpers and the channel count read in prepare from int to unsigned int.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Use source_cir_buf_wrap instead of cir_buf_wrap to advance the read-only
source pointer in the processing functions.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change the loop counter in the processing-function lookup helpers from
int to size_t so it matches crossover_proc_fncount and avoids a
signed/unsigned comparison.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
@softwarecki
softwarecki requested a review from a team as a code owner October 16, 2026 16:17
Copilot AI balanced review requested due to automatic review settings October 16, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no blocking issues in this focused API and type-safety refactor; builds and tests were not run.

0 open findings

What changed in this PR

Refactors the crossover component to use sink/source APIs and improves type safety without changing audio processing behavior.

Changes:

  • Replaces direct buffer access with sink/source APIs.
  • Uses unsigned channel counts and size_t lookup indices.
  • Preserves constness when wrapping source pointers.
File Description
src/​audio/​crossover/​crossover.h Updates helper signatures and lookup index types.
src/​audio/​crossover/​crossover.c Converts preparation and sink assignment to sink/source APIs.
src/​audio/​crossover/​crossover_ipc4.c Updates formats through sink/source APIs.
src/​audio/​crossover/​crossover_ipc3.c Aligns the no-op helper signature.
src/​audio/​crossover/​crossover_generic.c Uses const-correct source pointer wrapping.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants