lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 5 Jul 2009 21:37:16 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	joerg.roedel@....com, fujita.tomonori@....ntt.co.jp,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH 0/3] dma-mapping:remove CONFIG_HAVE_DMA_ATTRS

2009/7/5 Ming Lei <tom.leiming@...il.com>:
> On Sun, 5 Jul 2009 13:19:36 +0200
> Arnd Bergmann <arnd@...db.de> wrote:
>
>> On Saturday 04 July 2009, tom.leiming@...il.com wrote:
>> > 2,Disabling CONFIG_HAVE_DMA_ATTRS may lead to a compile failure;
>>
>> I'm not sure I understand this point. CONFIG_HAVE_DMA_ATTRS tells
>> the common code whether the architecture understands dma attributes.
>
> If a new arch does not define CONFIG_HAVE_DMA_ATTRS but uses
> dma-mapping-common.h, it will lead to a compile failure.
>
> include/asm-generic/dma-mapping-common.h
>
>        #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a,
>        s, r, NULL)
>        ...
>
> include/linux/dma-mapping.h
>
>        #ifndef CONFIG_HAVE_DMA_ATTRS
>        struct dma_attrs;
>
>        #define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \
>        dma_map_single(dev, cpu_addr, size, dir)
>        ...
>        #endif
>
>

I have another idea to fix the possible compile failure.  Does the
following patch
work?

diff --git a/include/asm-generic/dma-mapping-common.h
b/include/asm-generic/dma-mapping-common.h
index 5406a60..39e2ec5 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -6,6 +6,8 @@
 #include <linux/dma-debug.h>
 #include <linux/dma-attrs.h>

+#define ARCH_USE_DMA_MAPPING_COMMON
+
 static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
 					      size_t size,
 					      enum dma_data_direction dir,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 07dfd46..4be1121 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -219,6 +219,7 @@ static inline void
dmam_release_declared_memory(struct device *dev)
 }
 #endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */

+#ifndef ARCH_USE_DMA_MAPPING_COMMON
 #ifndef CONFIG_HAVE_DMA_ATTRS
 struct dma_attrs;

@@ -235,5 +236,7 @@ struct dma_attrs;
 	dma_unmap_sg(dev, sgl, nents, dir)

 #endif /* CONFIG_HAVE_DMA_ATTRS */
+#endif /* ARCH_USE_DMA_MAPPING_COMMON */
+

 #endif



-- 
Lei Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ