diff mbox series

ASoC: audio-graph-card: fix type mismatch warning

Message ID 20190712085605.4062896-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series ASoC: audio-graph-card: fix type mismatch warning | expand

Commit Message

Arnd Bergmann July 12, 2019, 8:55 a.m. UTC
The new temporary variable is lacks a 'const' annotation:

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]

Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Oleksandr Suvorov July 13, 2019, 12:57 p.m. UTC | #1
On Fri, 12 Jul 2019 at 11:57, Arnd Bergmann <arnd@arndb.de> wrote:
>
> The new temporary variable is lacks a 'const' annotation:
>
> 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]
>
> Fixes: c152f8491a8d ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.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..288df245b2f0 100644
> --- a/sound/soc/generic/audio-graph-card.c
> +++ b/sound/soc/generic/audio-graph-card.c
> @@ -63,7 +63,7 @@ static int graph_get_dai_id(struct device_node *ep)
>         struct device_node *endpoint;
>         struct of_endpoint info;
>         int i, id;
> -       u32 *reg;
> +       const u32 *reg;
>         int ret;
>
>         /* use driver specified DAI ID if exist */
> --
> 2.20.0
>
diff mbox series

Patch

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