public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: ipc4-topology: Fix application of sizeof to pointer
       [not found] <20230719015525.48613-1-zhanglibing@cdjrlc.com>
@ 2023-07-19  2:10 ` wuyonggang001
  0 siblings, 0 replies; 5+ messages in thread
From: wuyonggang001 @ 2023-07-19  2:10 UTC (permalink / raw)
  To: perex, tiwai; +Cc: linux-kernel

Sizeof is being applied to the pointer ptr, not the integer it points 
to.

Eliminate the following error(s):
./sound/soc/sof/ipc4-topology.c:221:29-35: ERROR: application of sizeof 
to pointer

Signed-off-by: Yonggang Wu <wuyonggang001@208suo.com>
---
  sound/soc/sof/ipc4-topology.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/ipc4-topology.c 
b/sound/soc/sof/ipc4-topology.c
index a4e1a70b607d..2dbe87dbd239 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -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;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer
       [not found] <20230720073836.3285-1-xujianghui@cdjrlc.com>
@ 2023-07-20  8:43 ` sunran001
  2023-07-24  9:11   ` Pierre-Louis Bossart
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: sunran001 @ 2023-07-20  8:43 UTC (permalink / raw)
  To: perex, tiwai; +Cc: alsa-devel, linux-kernel

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

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  sound/soc/sof/ipc4-topology.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/ipc4-topology.c 
b/sound/soc/sof/ipc4-topology.c
index a4e1a70b607d..2dbe87dbd239 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -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;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer
  2023-07-20  8:43 ` [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer sunran001
@ 2023-07-24  9:11   ` Pierre-Louis Bossart
  2023-07-25  8:16   ` Péter Ujfalusi
  2023-07-25 11:11   ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2023-07-24  9:11 UTC (permalink / raw)
  To: sunran001, perex, tiwai
  Cc: alsa-devel, linux-kernel, Mark Brown, Ranjani Sridharan,
	Péter Ujfalusi



On 7/20/23 10:43, sunran001@208suo.com wrote:
> The coccinelle check report:
> ./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of
> sizeof to pointer
> 
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
>  sound/soc/sof/ipc4-topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
> index a4e1a70b607d..2dbe87dbd239 100644
> --- a/sound/soc/sof/ipc4-topology.c
> +++ b/sound/soc/sof/ipc4-topology.c
> @@ -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;

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer
  2023-07-20  8:43 ` [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer sunran001
  2023-07-24  9:11   ` Pierre-Louis Bossart
@ 2023-07-25  8:16   ` Péter Ujfalusi
  2023-07-25 11:11   ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Péter Ujfalusi @ 2023-07-25  8:16 UTC (permalink / raw)
  To: sunran001, perex, tiwai
  Cc: alsa-devel, linux-kernel, Pierre-Louis Bossart, Ranjani Sridharan,
	Mark Brown



On 20/07/2023 11:43, sunran001@208suo.com 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>

Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
>  sound/soc/sof/ipc4-topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
> index a4e1a70b607d..2dbe87dbd239 100644
> --- a/sound/soc/sof/ipc4-topology.c
> +++ b/sound/soc/sof/ipc4-topology.c
> @@ -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.

>      if (ret) {
>          dev_err(scomp->dev, "Failed to parse audio format token count\n");
>          return ret;

-- 
Péter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer
  2023-07-20  8:43 ` [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer sunran001
  2023-07-24  9:11   ` Pierre-Louis Bossart
  2023-07-25  8:16   ` Péter Ujfalusi
@ 2023-07-25 11:11   ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2023-07-25 11:11 UTC (permalink / raw)
  To: sunran001; +Cc: perex, tiwai, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Thu, Jul 20, 2023 at 04:43:57PM +0800, sunran001@208suo.com 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-25 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230720073836.3285-1-xujianghui@cdjrlc.com>
2023-07-20  8:43 ` [PATCH] ASoC: SOF: ipc4-topology: fix application of sizeof to pointer sunran001
2023-07-24  9:11   ` Pierre-Louis Bossart
2023-07-25  8:16   ` Péter Ujfalusi
2023-07-25 11:11   ` Mark Brown
     [not found] <20230719015525.48613-1-zhanglibing@cdjrlc.com>
2023-07-19  2:10 ` [PATCH] ASoC: SOF: ipc4-topology: Fix " wuyonggang001

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox