audio: volume: use unsigned int for channel count and iterators - #11248
Open
softwarecki wants to merge 1 commit into
Open
softwarecki wants to merge 1 commit into
softwarecki wants to merge 1 commit into
Conversation
Convert the local channel-count variables and the loops iterating over channels to unsigned int to match channels type in vol_data structure. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
softwarecki
requested review from
abonislawski,
lyakh,
piotrhoppeintel,
serhiy-katsyuba-intel,
tmleman and
wjablon1
September 29, 2026 19:20
softwarecki
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
September 29, 2026 19:20
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The mechanical type changes consistently match vol_data.channels without altering processing behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Aligns volume channel-count variables and iterators with the unsigned vol_data.channels type.
Changes:
- Converts local channel counts to
unsigned int. - Converts channel-specific loop iterators while preserving signed sample iterators.
- Applies the update across generic and HiFi optimized implementations.
| File | Description |
|---|---|
src/audio/volume/volume_hifi5.c |
Updates HiFi5 channel types. |
src/audio/volume/volume_hifi5_with_peakvol.c |
Updates HiFi5 peak-volume channel iterators. |
src/audio/volume/volume_hifi4.c |
Updates HiFi4 channel types. |
src/audio/volume/volume_hifi4_with_peakvol.c |
Updates HiFi4 peak-volume channel iterators. |
src/audio/volume/volume_hifi3.c |
Updates HiFi3 channel types. |
src/audio/volume/volume_hifi3_with_peakvol.c |
Updates HiFi3 peak-volume channel iterators. |
src/audio/volume/volume_generic.c |
Updates generic channel types. |
src/audio/volume/volume_generic_with_peakvol.c |
Updates generic peak-volume channel types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
lyakh
approved these changes
Sep 30, 2026
wjablon1
reviewed
Sep 30, 2026
| ae_f32x2 out_sample; | ||
| ae_f32x2 volume; | ||
| int i, n, m; | ||
| unsigned int j; |
Contributor
There was a problem hiding this comment.
you could probably just change type of "i" from int to unsigned instead of declaring "j"... or alternatively come up with more meaningful names for the two single purpose variables e.g. sample_idx, chan_idx... but I guess it's too late for this change because it's not your first modification of this kind.
wjablon1
approved these changes
Sep 30, 2026
kv2019i
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert the local channel-count variables and the loops iterating over channels to
unsigned intto match channels type invol_datastructure.