All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in acore/memalloc.patch in alsa-driver-1.0.7?
@ 2004-11-19 17:05 Stephen Warren
  2004-11-19 17:50 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2004-11-19 17:05 UTC (permalink / raw)
  To: alsa-devel

I've started reading all the *.patch files in the alsa-driver-1.0.7
package to see which patches actually change the code on 2.6.9. I found
something odd in acore/memalloc.patch.

Part of the patch is this:

==================================================
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#define VALID_DMA_MASK(dev)    (dev)->dma_mask
......
+#endif
+
 static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t
size,
                                         dma_addr_t *dma_handle, int
flags)
 {
        void *ret;
        u64 dma_mask, coherent_dma_mask;
 
-       if (dev == NULL || !dev->dma_mask)
+       if (dev == NULL || VALID_DMA_MASK(dev))
                return dma_alloc_coherent(dev, size, dma_handle, flags);
==================================================

This changes the code from

-       if (dev == NULL || !dev->dma_mask)

to:

-       if (dev == NULL || (dev)->dma_mask)

Once the macro is expanded for kernels 2.6.0 or later.

This seems to be a bug, since the test is inverted.

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com        http://www.nvidia.com/
swarren@wwwdotorg.org     http://www.wwwdotorg.org/pgp.html


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in acore/memalloc.patch in alsa-driver-1.0.7?
  2004-11-19 17:05 Bug in acore/memalloc.patch in alsa-driver-1.0.7? Stephen Warren
@ 2004-11-19 17:50 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2004-11-19 17:50 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel

At Fri, 19 Nov 2004 09:05:43 -0800,
Stephen Warren wrote:
> 
> This changes the code from
> 
> -       if (dev == NULL || !dev->dma_mask)
> 
> to:
> 
> -       if (dev == NULL || (dev)->dma_mask)
> 
> Once the macro is expanded for kernels 2.6.0 or later.
> 
> This seems to be a bug, since the test is inverted.

Yep, you're ring.  Now fixed on cvs.
Thanks.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-19 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19 17:05 Bug in acore/memalloc.patch in alsa-driver-1.0.7? Stephen Warren
2004-11-19 17:50 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.