All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: David Laight <David.Laight@aculab.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
	"shengjiu.wang@gmail.com" <shengjiu.wang@gmail.com>,
	'Shengjiu Wang' <shengjiu.wang@nxp.com>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next 2/5] ASoC: fsl_asrc: force cast the asrc_format type
Date: Tue, 19 Jul 2022 11:17:09 +0100	[thread overview]
Message-ID: <YtaEpf6Cd7KH7wH4@sirena.org.uk> (raw)
In-Reply-To: <f2609401c8834e8bbe926200bfc87971@AcuMS.aculab.com>

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

On Tue, Jul 19, 2022 at 10:01:54AM +0000, David Laight wrote:
> From: Shengjiu Wang

> > -	ret = of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format);
> > +	ret = of_property_read_u32(np, "fsl,asrc-format", (u32 *)&asrc->asrc_format);

> Ugg, you really shouldn't need to do that.
> It means that something is badly wrong somewhere.
> Casting pointers to integer types is just asking for a bug.

That's casting one pointer type to another pointer type.

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

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: David Laight <David.Laight@aculab.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
	"shengjiu.wang@gmail.com" <shengjiu.wang@gmail.com>,
	'Shengjiu Wang' <shengjiu.wang@nxp.com>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next 2/5] ASoC: fsl_asrc: force cast the asrc_format type
Date: Tue, 19 Jul 2022 11:17:09 +0100	[thread overview]
Message-ID: <YtaEpf6Cd7KH7wH4@sirena.org.uk> (raw)
In-Reply-To: <f2609401c8834e8bbe926200bfc87971@AcuMS.aculab.com>

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

On Tue, Jul 19, 2022 at 10:01:54AM +0000, David Laight wrote:
> From: Shengjiu Wang

> > -	ret = of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format);
> > +	ret = of_property_read_u32(np, "fsl,asrc-format", (u32 *)&asrc->asrc_format);

> Ugg, you really shouldn't need to do that.
> It means that something is badly wrong somewhere.
> Casting pointers to integer types is just asking for a bug.

That's casting one pointer type to another pointer type.

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

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: David Laight <David.Laight@aculab.com>
Cc: 'Shengjiu Wang' <shengjiu.wang@nxp.com>,
	"shengjiu.wang@gmail.com" <shengjiu.wang@gmail.com>,
	"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next 2/5] ASoC: fsl_asrc: force cast the asrc_format type
Date: Tue, 19 Jul 2022 11:17:09 +0100	[thread overview]
Message-ID: <YtaEpf6Cd7KH7wH4@sirena.org.uk> (raw)
In-Reply-To: <f2609401c8834e8bbe926200bfc87971@AcuMS.aculab.com>

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

On Tue, Jul 19, 2022 at 10:01:54AM +0000, David Laight wrote:
> From: Shengjiu Wang

> > -	ret = of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format);
> > +	ret = of_property_read_u32(np, "fsl,asrc-format", (u32 *)&asrc->asrc_format);

> Ugg, you really shouldn't need to do that.
> It means that something is badly wrong somewhere.
> Casting pointers to integer types is just asking for a bug.

That's casting one pointer type to another pointer type.

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

  reply	other threads:[~2022-07-19 10:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  9:27 [PATCH -next 0/5] ASoC: fsl: Fix sparse warning Shengjiu Wang
2022-07-19  9:27 ` [PATCH -next 1/5] ASoC: fsl_sai: Don't use plain integer as NULL pointer Shengjiu Wang
2022-07-19  9:27 ` [PATCH -next 2/5] ASoC: fsl_asrc: force cast the asrc_format type Shengjiu Wang
2022-07-19 10:01   ` David Laight
2022-07-19 10:17     ` Mark Brown [this message]
2022-07-19 10:17       ` Mark Brown
2022-07-19 10:17       ` Mark Brown
2022-07-19 10:34       ` David Laight
2022-07-19 10:34         ` David Laight
2022-07-19 10:34         ` David Laight
2022-07-19 11:07         ` Shengjiu Wang
2022-07-19 11:07           ` Shengjiu Wang
2022-07-19 12:39           ` David Laight
2022-07-19 12:39             ` David Laight
2022-07-19 13:35             ` Shengjiu Wang
2022-07-19 13:35               ` Shengjiu Wang
2022-07-20  5:42               ` Shengjiu Wang
2022-07-20  5:42                 ` Shengjiu Wang
2022-07-19  9:27 ` [PATCH -next 3/5] ASoC: fsl-asoc-card: " Shengjiu Wang
2022-07-19  9:27 ` [PATCH -next 4/5] ASoC: fsl_easrc: use snd_pcm_format_t type for sample_format Shengjiu Wang
2022-07-19  9:27 ` [PATCH -next 5/5] ASoC: imx-card: use snd_pcm_format_t type for asrc_format Shengjiu Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YtaEpf6Cd7KH7wH4@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.