Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
More cppcheck fixes#4686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
More cppcheck fixes #4686
Changes from all commits
e185dff0a906e2fb20fad609b5c128a590fad960cc9b04a73f23a95ee93e2d40722e08File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -108,14 +108,15 @@ static int multiband_drc_init_coef(struct multiband_drc_comp_data *cd, int16_t n | ||
| struct sof_multiband_drc_config *config = cd->config; | ||
| struct multiband_drc_state *state = &cd->state; | ||
| uint32_t sample_bytes = get_sample_bytes(cd->source_format); | ||
| int num_bands = cd->config->num_bands; | ||
| int i, ch, ret; | ||
| int i, ch, ret, num_bands; | ||
| if (!config) { | ||
| comp_cl_err(&comp_multiband_drc, "multiband_drc_init_coef(), no config is set"); | ||
| return -EINVAL; | ||
| } | ||
| num_bands = config->num_bands; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use C99 declarations+initializations now? There was no significant objection in ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to make a final call on that in a TSC, hasn't been one in a while. | ||
| /* Sanity checks */ | ||
| if (nch > PLATFORM_MAX_CHANNELS) { | ||
| comp_cl_err(&comp_multiband_drc, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -132,7 +132,7 @@ static void find_modes(struct dai *dai, | ||
| mfir = fir_list[j]->decim_factor; | ||
| /* Skip if previous decimation factor was the same */ | ||
| if (j > 1 && fir_list[j - 1]->decim_factor == mfir) | ||
| if (j != 0 && fir_list[j - 1]->decim_factor == mfir) | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an actual flow change, is this intended? @singalsu is this correct? If this is fixing an error, we should indicate that. Also not sure why you're saying that this check is pointless? Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, there's a mistake, also a duplicate decimation factor in fir_list[1] should be checked for. The check should have been | ||
| continue; | ||
| mcic = osr / mfir; | ||
| @@ -593,7 +593,9 @@ static int configure_registers(struct dai *dai, | ||
| uint32_t ref; | ||
| int32_t ci; | ||
| uint32_t cu; | ||
| #if defined(DMIC_IPM_VER1) || defined(DMIC_IPM_VER2) | ||
| int ipm; | ||
| #endif | ||
| int of0; | ||
| int of1; | ||
| int fir_decim; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -189,7 +189,7 @@ int dmic_set_config_nhlt(struct dai *dai, void *spec_config) | ||
| uint32_t channel_ctrl_mask; | ||
| uint32_t fir_control; | ||
| uint32_t pdm_ctrl_mask; | ||
| uint32_t ref; | ||
| uint32_t ref = 0; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Again - probably unimportant, but just to be aware of. | ||
| uint32_t val; | ||
| const uint8_t *p = spec_config; | ||
| int num_fifos; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -187,7 +187,7 @@ ipc_cmd_hdr *mailbox_validate(void); | ||
| * | ||
| * @param hdr Points to the IPC command header. | ||
| */ | ||
| void ipc_cmd(ipc_cmd_hdr *hdr); | ||
| void ipc_cmd(ipc_cmd_hdr *_hdr); | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious what is the warning here. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That the signature in the header didnt match the implementation signature in the c files ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
| ||
| /** | ||
| * \brief IPC message to be processed on other core. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone needs to check that all calls to this are error-checked now, hopefully there's no hidden error but just in case.