Skip to contentSkip to conversation

unnecessary test?

DISCUSSION Julia Lawall 2 participants 5 messages Jun 6, 2018

lore
Share & tools
lore
#0 lore raw

In the file sound/pci/ctxfi/cthw20k1.c, the function daio_mgr_dao_init contains:

set_field(&ctl->spoctl, SPOCTL_OS << (idx*8),

          ((conf >> 3) & 0x1) ? 2 : 2); /* Raw */

Could the second argument just be 2? It's true that the preceeding call contains conf >> ..., but in a more useful way, so perhaps it could be useful for uniformity?

thanks,
julia

#1 lore raw
Quoted 9 lines · Julia Lawall

In the file sound/pci/ctxfi/cthw20k1.c, the function daio_mgr_dao_init contains:

set_field(&ctl->spoctl, SPOCTL_OS << (idx*8),

          ((conf >> 3) & 0x1) ? 2 : 2); /* Raw */

Could the second argument just be 2? It's true that the preceeding call contains conf >> ..., but in a more useful way, so perhaps it could be useful for uniformity?

There is similar code in daio_mgr_dao_init in sound/pci/ctxfi/cthw20k2.c:

        	set_field(&ctl->txctl[idx], ATXCTL_RAW,
                         ((conf >> 3) & 0x1) ? 0 : 0);

julia

#2 lore raw
In reply to Julia Lawall
Quoted 10 lines · Julia Lawall

In the file sound/pci/ctxfi/cthw20k1.c, the function daio_mgr_dao_init contains:

set_field(&ctl->spoctl, SPOCTL_OS << (idx*8),

          ((conf >> 3) & 0x1) ? 2 : 2); /* Raw */

Could the second argument just be 2? It's true that the preceeding call contains conf >> ..., but in a more useful way, so perhaps it could be useful for uniformity?

I guess this is a typo of "2 : 0". The code seems toggling the control bit depending on the S/PDIF passthru mode. It might be reversed, but I bet 1 for non-audio from a common sense.

Ditto for cthw20k1.c. This one is likely 1, not 2, though.

thanks,

Takashi

#3 lore raw
Quoted 13 lines · Takashi Iwai
Quoted 10 lines · Julia Lawall

In the file sound/pci/ctxfi/cthw20k1.c, the function daio_mgr_dao_init contains:

set_field(&ctl->spoctl, SPOCTL_OS << (idx*8),

          ((conf >> 3) & 0x1) ? 2 : 2); /* Raw */

Could the second argument just be 2? It's true that the preceeding call contains conf >> ..., but in a more useful way, so perhaps it could be useful for uniformity?

Quoted 5 lines

I guess this is a typo of "2 : 0". The code seems toggling the control bit depending on the S/PDIF passthru mode. It might be reversed, but I bet 1 for non-audio from a common sense.

Ditto for cthw20k1.c. This one is likely 1, not 2, though.

OK, should I send a patch? I have no way to test it.

julia

Quoted 6 lines

thanks,

Takashi

#4 lore raw
Quoted 18 lines · Julia Lawall
Quoted 13 lines · Takashi Iwai
Quoted 10 lines · Julia Lawall

In the file sound/pci/ctxfi/cthw20k1.c, the function daio_mgr_dao_init contains:

set_field(&ctl->spoctl, SPOCTL_OS << (idx*8),

          ((conf >> 3) & 0x1) ? 2 : 2); /* Raw */

Could the second argument just be 2? It's true that the preceeding call contains conf >> ..., but in a more useful way, so perhaps it could be useful for uniformity?

Quoted 7 lines
Quoted 5 lines

I guess this is a typo of "2 : 0". The code seems toggling the control bit depending on the S/PDIF passthru mode. It might be reversed, but I bet 1 for non-audio from a common sense.

Ditto for cthw20k1.c. This one is likely 1, not 2, though.

OK, should I send a patch? I have no way to test it.

Me neither :)

Feel free to submit the patch. The SPDIF output seems very rarely used on these devices (otherwise people must have noticed it), so the chance to break anything must be small.

thanks,

Takashi