mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mark dma_sync_single and dma_sync_sg as deprecated
@ 2009-05-19  4:00 FUJITA Tomonori
  2009-05-27 23:43 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2009-05-19  4:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

dma_sync_single() and dma_sync_sg() have been described as "Backwards
compat, remove in 2.7.x" for a long time (since 2.6.5).

This marks dma_sync_single() and dma_sync_sg() as deprecated so the
users get notified before removing them.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 include/linux/dma-mapping.h |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 8083b6a..197ddc4 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -107,9 +107,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
 #include <asm-generic/dma-mapping-broken.h>
 #endif
 
-/* Backwards compat, remove in 2.7.x */
-#define dma_sync_single		dma_sync_single_for_cpu
-#define dma_sync_sg		dma_sync_sg_for_cpu
+/* for backwards compatibility, removed soon */
+static inline void __deprecated dma_sync_single(struct device *dev,
+						dma_addr_t addr, size_t size,
+						enum dma_data_direction dir)
+{
+	dma_sync_single_for_cpu(dev, addr, size, dir);
+}
+
+static inline void __deprecated dma_sync_sg(struct device *dev,
+					    struct scatterlist *sg, int nelems,
+					    enum dma_data_direction dir)
+{
+	dma_sync_sg_for_cpu(dev, sg, nelems, dir);
+}
 
 static inline u64 dma_get_mask(struct device *dev)
 {
-- 
1.6.0.6


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

* Re: [PATCH] mark dma_sync_single and dma_sync_sg as deprecated
  2009-05-19  4:00 [PATCH] mark dma_sync_single and dma_sync_sg as deprecated FUJITA Tomonori
@ 2009-05-27 23:43 ` Andrew Morton
  2009-05-28  1:16   ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-05-27 23:43 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-kernel, linux-usb

On Tue, 19 May 2009 13:00:37 +0900
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> dma_sync_single() and dma_sync_sg() have been described as "Backwards
> compat, remove in 2.7.x" for a long time (since 2.6.5).
> 
> This marks dma_sync_single() and dma_sync_sg() as deprecated so the
> users get notified before removing them.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  include/linux/dma-mapping.h |   17 ++++++++++++++---
>  1 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 8083b6a..197ddc4 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -107,9 +107,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
>  #include <asm-generic/dma-mapping-broken.h>
>  #endif
>  
> -/* Backwards compat, remove in 2.7.x */
> -#define dma_sync_single		dma_sync_single_for_cpu
> -#define dma_sync_sg		dma_sync_sg_for_cpu
> +/* for backwards compatibility, removed soon */
> +static inline void __deprecated dma_sync_single(struct device *dev,
> +						dma_addr_t addr, size_t size,
> +						enum dma_data_direction dir)
> +{
> +	dma_sync_single_for_cpu(dev, addr, size, dir);
> +}
> +
> +static inline void __deprecated dma_sync_sg(struct device *dev,
> +					    struct scatterlist *sg, int nelems,
> +					    enum dma_data_direction dir)
> +{
> +	dma_sync_sg_for_cpu(dev, sg, nelems, dir);
> +}
>  
>  static inline u64 dma_get_mask(struct device *dev)
>  {

I dunno.  There are still several callers to dma_sync_single() and
dma_sync_sg() in various drivers and adding the warning will just
irritate people.  It would be better to make an effort to convert those
callsites before filling everyone's screens with yet more warnings.

Most of the offenders are in USB, so let's optimistically cc those fine
folks.


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

* Re: [PATCH] mark dma_sync_single and dma_sync_sg as deprecated
  2009-05-27 23:43 ` Andrew Morton
@ 2009-05-28  1:16   ` FUJITA Tomonori
  0 siblings, 0 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2009-05-28  1:16 UTC (permalink / raw)
  To: akpm; +Cc: fujita.tomonori, linux-kernel, linux-usb

On Wed, 27 May 2009 16:43:05 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 19 May 2009 13:00:37 +0900
> FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> 
> > dma_sync_single() and dma_sync_sg() have been described as "Backwards
> > compat, remove in 2.7.x" for a long time (since 2.6.5).
> > 
> > This marks dma_sync_single() and dma_sync_sg() as deprecated so the
> > users get notified before removing them.
> > 
> > Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> > ---
> >  include/linux/dma-mapping.h |   17 ++++++++++++++---
> >  1 files changed, 14 insertions(+), 3 deletions(-)
> > 
> > diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> > index 8083b6a..197ddc4 100644
> > --- a/include/linux/dma-mapping.h
> > +++ b/include/linux/dma-mapping.h
> > @@ -107,9 +107,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
> >  #include <asm-generic/dma-mapping-broken.h>
> >  #endif
> >  
> > -/* Backwards compat, remove in 2.7.x */
> > -#define dma_sync_single		dma_sync_single_for_cpu
> > -#define dma_sync_sg		dma_sync_sg_for_cpu
> > +/* for backwards compatibility, removed soon */
> > +static inline void __deprecated dma_sync_single(struct device *dev,
> > +						dma_addr_t addr, size_t size,
> > +						enum dma_data_direction dir)
> > +{
> > +	dma_sync_single_for_cpu(dev, addr, size, dir);
> > +}
> > +
> > +static inline void __deprecated dma_sync_sg(struct device *dev,
> > +					    struct scatterlist *sg, int nelems,
> > +					    enum dma_data_direction dir)
> > +{
> > +	dma_sync_sg_for_cpu(dev, sg, nelems, dir);
> > +}
> >  
> >  static inline u64 dma_get_mask(struct device *dev)
> >  {
> 
> I dunno.  There are still several callers to dma_sync_single() and
> dma_sync_sg() in various drivers and adding the warning will just
> irritate people.  It would be better to make an effort to convert those
> callsites before filling everyone's screens with yet more warnings.

Ok, I was too lazy. I tried to irritate people to fix them but yeah
it's not a polite way. I've just sent patches to convert all those
callsites.


> Most of the offenders are in USB, so let's optimistically cc those fine
> folks.

Actually, all the callsites in USB are wrapped with '#ifdef 0'. So
they don't get any warnings due to this patch.

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

end of thread, other threads:[~2009-05-28  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-19  4:00 [PATCH] mark dma_sync_single and dma_sync_sg as deprecated FUJITA Tomonori
2009-05-27 23:43 ` Andrew Morton
2009-05-28  1:16   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®