Skip to contentSkip to conversation

ASoC: rsnd: fixup index of SSI mod when SRC is used

PATCH In review Jürg Billeter 2 participants 5 messages Jul 2, 2014 – Jul 4, 2014

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

PATCH 1/1 ASoC: rsnd: fixup index of SSI mod when SRC is used

The default index 1 was used as the loop was terminated before the following code could be reached:

	if (mod[i] == this)
		index = i;
---
 sound/soc/sh/rcar/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +4 -2
index 4e86265..d737fea 100644
@@ -295,9 +295,11 @@ static void rsnd_dma_of_name(struct rsnd_dma *dma,
 	mod[0] = NULL; /* for "mem" */
 	index = 1;
 	for (i = 1; i < MOD_MAX; i++) {
-		if (!src) {
-			mod[i] = ssi;
+		if (!ssi) {
 			break;
+		} else if (!src) {
+			mod[i] = ssi;
+			ssi = NULL;
 		} else if (!dvc) {
 			mod[i] = src;
 			src = NULL;
Signature · 1 line
2.0.1
#1 lore raw

Hi

If you add this code,

        if (!ssi) {
               break;
        } else ...

then, I guess we can remove this code ?

	if (mod[i] == ssi)
	break;

2014-07-02 20:18 GMT+09:00 Jürg Billeter <[email protected]>:

Quoted 32 lines

The default index 1 was used as the loop was terminated before the following code could be reached:

        if (mod[i] == this)
                index = i;
---
 sound/soc/sh/rcar/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +4 -3
index 4e86265..d737fea 100644
@@ -295,9 +295,11 @@ static void rsnd_dma_of_name(struct rsnd_dma *dma,
        mod[0] = NULL; /* for "mem" */
        index = 1;
        for (i = 1; i < MOD_MAX; i++) {
-               if (!src) {
-                       mod[i] = ssi;
+               if (!ssi) {
                        break;
+               } else if (!src) {
+                       mod[i] = ssi;
+                       ssi = NULL;
                } else if (!dvc) {
                        mod[i] = src;
                        src = NULL;
--

2.0.1

Quoted 5 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw

Hi again

2014-07-03 22:57 GMT+09:00 Kuninori Morimoto <[email protected]

Quoted 6 lines

:

Hi

If you add this code,

Quoted 11 lines
        if (!ssi) {
               break;
        } else ...

then, I guess we can remove this code ?

	if (mod[i] == ssi)
	break;

Maybe this is not correct comment.
Now, I'm confusing about this patch.
What kind of issue happen without this patch ?

Quoted 35 lines

2014-07-02 20:18 GMT+09:00 Jürg Billeter <[email protected]>:

The default index 1 was used as the loop was terminated before the

Quoted 31 lines

following code could be reached:

        if (mod[i] == this)
                index = i;
---
 sound/soc/sh/rcar/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +4 -3
index 4e86265..d737fea 100644
@@ -295,9 +295,11 @@ static void rsnd_dma_of_name(struct rsnd_dma *dma,
        mod[0] = NULL; /* for "mem" */
        index = 1;
        for (i = 1; i < MOD_MAX; i++) {
-               if (!src) {
-                       mod[i] = ssi;
+               if (!ssi) {
                        break;
+               } else if (!src) {
+                       mod[i] = ssi;
+                       ssi = NULL;
                } else if (!dvc) {
                        mod[i] = src;
                        src = NULL;
--

2.0.1

Quoted 7 lines
Quoted 5 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
In reply to Kuninori Morimoto

Hi,

Quoted 10 lines · Kuninori Morimoto

If you add this code,

        if (!ssi) {
               break;
        } else ...

then, I guess we can remove this code ?

	if (mod[i] == ssi)
	break;

I checked the issue on mainline master where the above two lines are not present yet. Looking at Mark's for-next tree reveals that you already fixed the issue in a slightly different way (commit c08c3b08). You may disregard my patch.

Jürg

#4 lore raw

Hi Jürg

I checked the issue on mainline master where the above two lines are not

Quoted 4 lines

present yet. Looking at Mark's for-next tree reveals that you already fixed the issue in a slightly different way (commit c08c3b08). You may disregard my patch.

I understand.
Thank you for your reply, and thank you for your test.
_______________________________________________
Alsa-devel mailing list [email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel