Skip to contentSkip to conversation

ASoC: audio-graph-card: Constify reg in graph_get_dai_id

PATCH Superseded Nathan Chancellor 2 participants 4 messages Jul 12, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: audio-graph-card: Constify reg in graph_get_dai_id

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()")
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/generic/audio-graph-card.c +1 -1
index c8abb86afefa..c0d262a2ce2c 100644
@@ -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 */
Signature · 1 line
2.22.0
#1 lore raw

PATCH v2 1/1 ASoC: audio-graph-card: Constify reg in graph_get_dai_id

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()")

---

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(-)
sound/soc/generic/audio-graph-card.c +1 -1
index c8abb86afefa..c0d262a2ce2c 100644
@@ -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 */
Signature · 1 line
2.22.0
#2 lore raw

Hi Nathan

Quoted 7 lines

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);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

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()")

---

Maybe

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

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

#3 lore raw
Quoted 21 lines · Kuninori Morimoto

Hi Nathan

Quoted 7 lines

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);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

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()")

---

Maybe

Quoted 7 lines

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