Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/audio/smart_amp/smart_amp_maxim_dsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int maxim_dsm_get_param(struct smart_amp_mod_struct_t *hspk,
{
struct smart_amp_caldata *caldata = &hspk->param.caldata;
size_t bs;
int ret = 0;
int ret;

if (caldata->data) {
/* reset data_pos variable in case of copying first element */
Expand Down Expand Up @@ -243,7 +243,7 @@ int maxim_dsm_set_param(struct smart_amp_mod_struct_t *hspk,
value[DSM_SET_VALUE_IDX] = param->param.value;

id = DSM_CH_MASK(param->param.id);
ch = param->param.id & DSM_CH1_BITMASK ? 0 : 1;
ch = (param->param.id & DSM_CH1_BITMASK) ? 0 : 1;

/* 2nd channel has (hspk->param.max_param * DSM_PARAM_MAX) sized offset */
db[(id + ch * hspk->param.max_param) * DSM_PARAM_MAX + DSM_PARAM_VALUE] =
Expand Down
9 changes: 0 additions & 9 deletions src/drivers/imx/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,9 @@ static int edma_setup_tcd(struct dma_chan_data *channel, int16_t soff,
static int edma_set_config(struct dma_chan_data *channel,
struct dma_sg_config *config)
{
int handshake, irq;
int16_t soff = 0;
int16_t doff = 0;

/* We may need to pass some data through the handshake in the
* future, so we just have them here, even if unused for now
*/
(void)handshake;
(void)irq;

tr_info(&edma_tr, "EDMA: set config");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have you considered #if 0 for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

checkpatch gets mad at that, tried it for the pdm_controllers_configuration removal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@marc-hb @cujomalainey I'm fine with this change. There is git history to keep this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can't find in git history what you don't even know exists, that's why it's sometimes worth keeping some dead code. In fact it's not straight forward to find deleted code in git history even when you know it was deleted. Emphasis on sometimes because I do NOT know this particular code, so maybe this one is NOT worth keeping despite the comment saying it should be kept.

As documented by the checkpatch maintainer, checkpatch is not always right and unlike cppcheck it's incremental so easy to ignore from time to time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@marc-hb In this specific case I'm fine with dropping the code despite my original comment. Something changed in handshake handling in the ESAI and SAI drivers and this code was indeed stale. Removing was the correct action.


channel->is_scheduling_source = config->is_scheduling_source;
Expand All @@ -365,12 +358,10 @@ static int edma_set_config(struct dma_chan_data *channel,
case DMA_DIR_MEM_TO_DEV:
soff = config->src_width;
doff = 0;
handshake = config->dest_dev;
break;
case DMA_DIR_DEV_TO_MEM:
soff = 0;
doff = config->dest_width;
handshake = config->src_dev;
break;
default:
tr_err(&edma_tr, "edma_set_config() unsupported config direction");
Expand Down
8 changes: 8 additions & 0 deletions src/drivers/imx/sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ static int sdma_upload_context(struct dma_chan_data *chan)
*/
return sdma_run_c0(chan->dma, SDMA_CMD_C0_SET_DM, (uint32_t)pdata->ctx,
SDMA_SRAM_CONTEXTS_BASE +
/* https://trac.cppcheck.net/ticket/10179 */
/* cppcheck-suppress divideSizeof */
chan->index * sizeof(*pdata->ctx) / 4,
/* https://trac.cppcheck.net/ticket/10179 */
/* cppcheck-suppress divideSizeof */
sizeof(*pdata->ctx) / 4);
}

Expand All @@ -272,6 +276,8 @@ static int sdma_upload_contexts_all(struct dma *dma)
return sdma_run_c0(dma, SDMA_CMD_C0_SET_DM, (uint32_t)pdata->contexts,
SDMA_SRAM_CONTEXTS_BASE,
dma->plat_data.channels *
/* https://trac.cppcheck.net/ticket/10179 */
/* cppcheck-suppress divideSizeof */
sizeof(*pdata->contexts) / 4);
}

Expand All @@ -288,6 +294,8 @@ static int sdma_download_contexts_all(struct dma *dma)
ret = sdma_run_c0(dma, SDMA_CMD_C0_GET_DM, (uint32_t)pdata->contexts,
SDMA_SRAM_CONTEXTS_BASE,
dma->plat_data.channels *
/* https://trac.cppcheck.net/ticket/10179 */
/* cppcheck-suppress divideSizeof */
sizeof(*pdata->contexts) / 4);

dcache_invalidate_region(pdata->contexts, sizeof(*pdata->contexts));
Expand Down
18 changes: 0 additions & 18 deletions src/drivers/intel/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,6 @@ struct dmic_configuration {
int32_t fir_b_scale;
};

struct pdm_controllers_configuration {
uint32_t cic_control;
uint32_t cic_config;
uint32_t mic_control;
uint32_t fir_control_a;
uint32_t fir_config_a;
uint32_t dc_offset_left_a;
uint32_t dc_offset_right_a;
uint32_t out_gain_left_a;
uint32_t out_gain_right_a;
uint32_t fir_control_b;
uint32_t fir_config_b;
uint32_t dc_offset_left_b;
uint32_t dc_offset_right_b;
uint32_t out_gain_left_b;
uint32_t out_gain_right_b;
};

/* Configuration ABI version, increment if not compatible with previous
* version.
*/
Expand Down