Skip to contentSkip to conversation

ASoC: SOF: ipc4-topology: fix application of sizeof to pointer

PATCH In review [email protected] 4 participants 4 messages Jul 20, 2023 – Jul 25, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 ASoC: SOF: ipc4-topology: fix application of sizeof to pointer

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of sizeof to pointer

---
 sound/soc/sof/ipc4-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/ipc4-topology.c +1 -1
index a4e1a70b607d..2dbe87dbd239 100644
@@ -218,7 +218,7 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp,
 
 	ret = sof_update_ipc_object(scomp, available_fmt,
 				    SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples,
-				    swidget->num_tuples, sizeof(available_fmt), 1);
+				    swidget->num_tuples, sizeof(*available_fmt), 1);
 	if (ret) {
 		dev_err(scomp->dev, "Failed to parse audio format token count\n");
 		return ret;
#2 lore raw
Quoted 22 lines · On 7/20/23 10:43, [email protected] wrote:

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of sizeof to pointer

---
 sound/soc/sof/ipc4-topology.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/ipc4-topology.c +1 -1
index a4e1a70b607d..2dbe87dbd239 100644
@@ -218,7 +218,7 @@ static int sof_ipc4_get_audio_fmt(struct
 snd_soc_component *scomp,
 
      ret = sof_update_ipc_object(scomp, available_fmt,
                      SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples,
-                    swidget->num_tuples, sizeof(available_fmt), 1);
+                    swidget->num_tuples, sizeof(*available_fmt), 1);
      if (ret) {
          dev_err(scomp->dev, "Failed to parse audio format token count\n");
Quoted 1 line

         return ret;

you need to Cc: maintainers and SOF folks who are knowledgeable on IPC4.

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to [email protected]
Quoted 3 lines · On 20/07/2023 11:43, [email protected] wrote:

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of sizeof to pointer

Please include the maintainers for patches to enusre they reach the correct audience, if in doubt who should be on TO/CC, use the scripts/get_maintainer.pl <patch file>

Quoted 10 lines

---
 sound/soc/sof/ipc4-topology.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/ipc4-topology.c +0 -0
index a4e1a70b607d..2dbe87dbd239 100644

sound/soc/sof/ipc4-topology.c static int sof_ipc4_get_audio_fmt(struct · line 222

Quoted 6 lines
sound/soc/sof/ipc4-topology.c +1 -1
@@ -218,7 +218,7 @@ static int sof_ipc4_get_audio_fmt(struct
 snd_soc_component *scomp,
 
      ret = sof_update_ipc_object(scomp, available_fmt,
                      SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples,
-                    swidget->num_tuples, sizeof(available_fmt), 1);
+                    swidget->num_tuples, sizeof(*available_fmt), 1);

The second last parameter is in essence unused since we only update a single item.
The patch is correct in a semantic way but the original code worked correctly.

Quoted 3 lines
sound/soc/sof/ipc4-topology.c +0 -0
      if (ret) {
          dev_err(scomp->dev, "Failed to parse audio format token count\n");

         return ret;

Signature · 1 line
Péter
maintainer
#4 lore raw
In reply to [email protected]
Quoted 3 lines · On Thu, Jul 20, 2023 at 04:43:57PM +0800, [email protected] wrote:

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of sizeof to pointer

This doesn't apply against current code, please check and resend.