linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: audio-graph-card: Constify reg in graph_get_dai_id
@ 2019-07-12  1:43 Nathan Chancellor
  2019-07-12  1:45 ` [PATCH v2] " Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2019-07-12  1:43 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto, Wen Yang,
	alsa-devel, linux-kernel, clang-built-linux, Nathan Chancellor

clang errors:

sound/soc/generic/audio-graph-card.c:87:7: error: assigning to 'u32 *'
(aka 'unsigned int *') from 'const void *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                reg = of_get_property(node, "reg", NULL);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Move the declaration up a bit to keep the reverse christmas tree look.

Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
Link: https://github.com/ClangBuiltLinux/linux/issues/599
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index c8abb86afefa..c0d262a2ce2c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -62,8 +62,8 @@ static int graph_get_dai_id(struct device_node *ep)
 	struct device_node *node;
 	struct device_node *endpoint;
 	struct of_endpoint info;
+	const u32 *reg;
 	int i, id;
-	u32 *reg;
 	int ret;
 
 	/* use driver specified DAI ID if exist */
-- 
2.22.0


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

* [PATCH v2] ASoC: audio-graph-card: Constify reg in graph_get_dai_id
  2019-07-12  1:43 [PATCH] ASoC: audio-graph-card: Constify reg in graph_get_dai_id Nathan Chancellor
@ 2019-07-12  1:45 ` Nathan Chancellor
  2019-07-12  3:37   ` Kuninori Morimoto
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2019-07-12  1:45 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto, Wen Yang,
	alsa-devel, linux-kernel, clang-built-linux, Nathan Chancellor

clang errors:

sound/soc/generic/audio-graph-card.c:87:7: error: assigning to 'u32 *'
(aka 'unsigned int *') from 'const void *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                reg = of_get_property(node, "reg", NULL);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Move the declaration up a bit to keep the reverse christmas tree look.

Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
Link: https://github.com/ClangBuiltLinux/linux/issues/600
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

v1 -> v2:

* Update link in commit message (sorry, I create the commit message and
  send the patch first then create the issue and I forgot to check the
  closed ones for the correct number)

 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index c8abb86afefa..c0d262a2ce2c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -62,8 +62,8 @@ static int graph_get_dai_id(struct device_node *ep)
 	struct device_node *node;
 	struct device_node *endpoint;
 	struct of_endpoint info;
+	const u32 *reg;
 	int i, id;
-	u32 *reg;
 	int ret;
 
 	/* use driver specified DAI ID if exist */
-- 
2.22.0


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

* Re: [PATCH v2] ASoC: audio-graph-card: Constify reg in graph_get_dai_id
  2019-07-12  1:45 ` [PATCH v2] " Nathan Chancellor
@ 2019-07-12  3:37   ` Kuninori Morimoto
  2019-07-12  3:52     ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2019-07-12  3:37 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Wen Yang, alsa-devel, linux-kernel, clang-built-linux


Hi Nathan

> clang errors:
> 
> sound/soc/generic/audio-graph-card.c:87:7: error: assigning to 'u32 *'
> (aka 'unsigned int *') from 'const void *' discards qualifiers
> [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>                 reg = of_get_property(node, "reg", NULL);
>                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> 
> Move the declaration up a bit to keep the reverse christmas tree look.
> 
> Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
> Link: https://github.com/ClangBuiltLinux/linux/issues/600
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---

Maybe

ec3042ad39d4e2ddbc3a3344f90bb10d8feb53bc
("ASoC: audio-graph-card: add missing const at graph_get_dai_id()")

Thank you for your help !!
Best regards
---
Kuninori Morimoto

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

* Re: [PATCH v2] ASoC: audio-graph-card: Constify reg in graph_get_dai_id
  2019-07-12  3:37   ` Kuninori Morimoto
@ 2019-07-12  3:52     ` Nathan Chancellor
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2019-07-12  3:52 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Wen Yang, alsa-devel, linux-kernel, clang-built-linux

On Fri, Jul 12, 2019 at 12:37:51PM +0900, Kuninori Morimoto wrote:
> 
> Hi Nathan
> 
> > clang errors:
> > 
> > sound/soc/generic/audio-graph-card.c:87:7: error: assigning to 'u32 *'
> > (aka 'unsigned int *') from 'const void *' discards qualifiers
> > [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> >                 reg = of_get_property(node, "reg", NULL);
> >                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 1 error generated.
> > 
> > Move the declaration up a bit to keep the reverse christmas tree look.
> > 
> > Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
> > Link: https://github.com/ClangBuiltLinux/linux/issues/600
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> 
> Maybe
> 
> ec3042ad39d4e2ddbc3a3344f90bb10d8feb53bc
> ("ASoC: audio-graph-card: add missing const at graph_get_dai_id()")
> 
> Thank you for your help !!
> Best regards
> ---
> Kuninori Morimoto

Ugh, I even checked Mark's tree before sending this, just completely
glossed over that patch. Sorry for the noise :(

Cheers,
Nathan

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

end of thread, other threads:[~2019-07-12  3:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  1:43 [PATCH] ASoC: audio-graph-card: Constify reg in graph_get_dai_id Nathan Chancellor
2019-07-12  1:45 ` [PATCH v2] " Nathan Chancellor
2019-07-12  3:37   ` Kuninori Morimoto
2019-07-12  3:52     ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).