Skip to contentSkip to conversation

question about sound/oss/vidc.c

DISCUSSION Julia Lawall 3 participants 4 messages Mar 16, 2010 – Mar 20, 2010

lore
Share & tools
lore
#0 lore raw

In sound/oss/vidc.c, the function vidc_audio_trigger contains thefollowing code:

        struct audio_operations *adev = audio_devs[dev];

        if (enable_bits & PCM_ENABLE_OUTPUT) {
                if (!(adev->flags & DMA_ACTIVE)) {
                        unsigned long flags;

                        local_irq_save(flags);

                        /* prevent recusion */
                        adev->flags |= DMA_ACTIVE;

			...
		}
	}

I wonder if the use of DMA_ACTIVE is correct? This constant is defined inthe file sound/oss/dev_table.h within the definition of the structure dma_buffparms. But here it is being used with the structure audio_operations. The definition of audio_operations also contains the definitions of some constants. Indeed, one of them, DMA_DUPLEX has the same value as DMA_ACTIVE.

thanks,
julia

#1 lore raw

[Cc'ed to Russell, the driver author]

At Tue, 16 Mar 2010 23:02:54 +0100 (CET),

Quoted 19 lines · Julia Lawall

In sound/oss/vidc.c, the function vidc_audio_trigger contains thefollowing code:

        struct audio_operations *adev = audio_devs[dev];

        if (enable_bits & PCM_ENABLE_OUTPUT) {
                if (!(adev->flags & DMA_ACTIVE)) {
                        unsigned long flags;

                        local_irq_save(flags);

                        /* prevent recusion */
                        adev->flags |= DMA_ACTIVE;

			...
		}
	}
Quoted 6 lines

I wonder if the use of DMA_ACTIVE is correct? This constant is defined inthe file sound/oss/dev_table.h within the definition of the structure dma_buffparms. But here it is being used with the structure audio_operations. The definition of audio_operations also contains the definitions of some constants. Indeed, one of them, DMA_DUPLEX has the same value as DMA_ACTIVE.

I guess these should be adev->dma_out->flags instead.

thanks,

Takashi

#2 lore raw
Quoted 1 line · Takashi Iwai

I guess these should be adev->dma_out->flags instead.

Yes, I think so too.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#3 lore raw
Quoted 4 lines · Russell King
Quoted 1 line · Takashi Iwai

I guess these should be adev->dma_out->flags instead.

Yes, I think so too.

Thanks. I sent a patch.

julia