Skip to content

Commit 5b5089e

Browse files
arndbbroonie
authored andcommitted
ASoC: q6dsp: fix event handler prototype
clang-16 points out a mismatch in function types that was hidden by a typecast: sound/soc/qcom/qdsp6/q6apm-dai.c:355:38: error: cast from 'void (*)(uint32_t, uint32_t, uint32_t *, void *)' (aka 'void (*)(unsigned int, unsigned int, unsigned int *, void *)') to 'q6apm_cb' (aka 'void (*)(unsigned int, unsigned int, void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 355 | prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id); sound/soc/qcom/qdsp6/q6apm-dai.c:499:38: error: cast from 'void (*)(uint32_t, uint32_t, uint32_t *, void *)' (aka 'void (*)(unsigned int, unsigned int, unsigned int *, void *)') to 'q6apm_cb' (aka 'void (*)(unsigned int, unsigned int, void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] 499 | prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler_compr, prtd, graph_id); The only difference here is the 'payload' argument, which is not even used in this function, so just fix its type and remove the cast. Fixes: 88b60bf ("ASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://msgid.link/r/20240213101105.459402-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f7fe85b commit 5b5089e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sound/soc/qcom/qdsp6/q6apm-dai.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static struct snd_pcm_hardware q6apm_dai_hardware_playback = {
123123
.fifo_size = 0,
124124
};
125125

126-
static void event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv)
126+
static void event_handler(uint32_t opcode, uint32_t token, void *payload, void *priv)
127127
{
128128
struct q6apm_dai_rtd *prtd = priv;
129129
struct snd_pcm_substream *substream = prtd->substream;
@@ -157,7 +157,7 @@ static void event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, vo
157157
}
158158

159159
static void event_handler_compr(uint32_t opcode, uint32_t token,
160-
uint32_t *payload, void *priv)
160+
void *payload, void *priv)
161161
{
162162
struct q6apm_dai_rtd *prtd = priv;
163163
struct snd_compr_stream *substream = prtd->cstream;
@@ -352,7 +352,7 @@ static int q6apm_dai_open(struct snd_soc_component *component,
352352

353353
spin_lock_init(&prtd->lock);
354354
prtd->substream = substream;
355-
prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id);
355+
prtd->graph = q6apm_graph_open(dev, event_handler, prtd, graph_id);
356356
if (IS_ERR(prtd->graph)) {
357357
dev_err(dev, "%s: Could not allocate memory\n", __func__);
358358
ret = PTR_ERR(prtd->graph);
@@ -496,7 +496,7 @@ static int q6apm_dai_compr_open(struct snd_soc_component *component,
496496
return -ENOMEM;
497497

498498
prtd->cstream = stream;
499-
prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler_compr, prtd, graph_id);
499+
prtd->graph = q6apm_graph_open(dev, event_handler_compr, prtd, graph_id);
500500
if (IS_ERR(prtd->graph)) {
501501
ret = PTR_ERR(prtd->graph);
502502
kfree(prtd);

0 commit comments

Comments
 (0)