All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove DMA_nBIT_MASK macro
@ 2009-05-07  5:14 FUJITA Tomonori
  2009-05-07  5:33 ` Yang Hongyang
  2009-05-07  5:34 ` [PATCH] remove DMA_nBIT_MASK macro Andrew Morton
  0 siblings, 2 replies; 17+ messages in thread
From: FUJITA Tomonori @ 2009-05-07  5:14 UTC (permalink / raw)
  To: akpm; +Cc: yanghy, linux-kernel, netdev, linux-arm-kernel

We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?

As long as these macros exist, people use them. The current git has
two users and linux-next have other users.

Is it better to remove DMA_nBIT_MASK macros completely now?

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] remove DMA_nBIT_MASK macros

This removes DMA_nBIT_MASK macros in dma-mapping.h so that we will not
have any new users.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/arm/mach-davinci/board-dm644x-evm.c |    4 ++--
 drivers/net/igbvf/netdev.c               |   13 +++++++------
 include/linux/dma-mapping.h              |   19 -------------------
 3 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index c039674..b2e7f9c 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -211,7 +211,7 @@ static struct resource ide_resources[] = {
 	},
 };
 
-static u64 ide_dma_mask = DMA_32BIT_MASK;
+static u64 ide_dma_mask = DMA_BIT_MASK(32);
 
 static struct platform_device ide_dev = {
 	.name           = "palm_bk3710",
@@ -220,7 +220,7 @@ static struct platform_device ide_dev = {
 	.num_resources  = ARRAY_SIZE(ide_resources),
 	.dev = {
 		.dma_mask		= &ide_dma_mask,
-		.coherent_dma_mask      = DMA_32BIT_MASK,
+		.coherent_dma_mask      = DMA_BIT_MASK(32),
 	},
 };
 
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index b774666..c084d3b 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -1279,7 +1279,7 @@ static void igbvf_configure_tx(struct igbvf_adapter *adapter)
 	/* Setup the HW Tx Head and Tail descriptor pointers */
 	ew32(TDLEN(0), tx_ring->count * sizeof(union e1000_adv_tx_desc));
 	tdba = tx_ring->dma;
-	ew32(TDBAL(0), (tdba & DMA_32BIT_MASK));
+	ew32(TDBAL(0), (tdba & DMA_BIT_MASK(32)));
 	ew32(TDBAH(0), (tdba >> 32));
 	ew32(TDH(0), 0);
 	ew32(TDT(0), 0);
@@ -1365,7 +1365,7 @@ static void igbvf_configure_rx(struct igbvf_adapter *adapter)
 	 * the Base and Length of the Rx Descriptor Ring
 	 */
 	rdba = rx_ring->dma;
-	ew32(RDBAL(0), (rdba & DMA_32BIT_MASK));
+	ew32(RDBAL(0), (rdba & DMA_BIT_MASK(32)));
 	ew32(RDBAH(0), (rdba >> 32));
 	ew32(RDLEN(0), rx_ring->count * sizeof(union e1000_adv_rx_desc));
 	rx_ring->head = E1000_RDH(0);
@@ -2637,15 +2637,16 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
 		return err;
 
 	pci_using_dac = 0;
-	err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
+	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
 	if (!err) {
-		err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
 		if (!err)
 			pci_using_dac = 1;
 	} else {
-		err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+		err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
 		if (err) {
-			err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+			err = pci_set_consistent_dma_mask(pdev,
+							  DMA_BIT_MASK(32));
 			if (err) {
 				dev_err(&pdev->dev, "No usable DMA "
 				        "configuration, aborting\n");
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 8083b6a..f56e607 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -63,25 +63,6 @@ struct dma_map_ops {
 
 #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
-/*
- * NOTE: do not use the below macros in new code and do not add new definitions
- * here.
- *
- * Instead, just open-code DMA_BIT_MASK(n) within your driver
- */
-#define DMA_64BIT_MASK	DMA_BIT_MASK(64)
-#define DMA_48BIT_MASK	DMA_BIT_MASK(48)
-#define DMA_47BIT_MASK	DMA_BIT_MASK(47)
-#define DMA_40BIT_MASK	DMA_BIT_MASK(40)
-#define DMA_39BIT_MASK	DMA_BIT_MASK(39)
-#define DMA_35BIT_MASK	DMA_BIT_MASK(35)
-#define DMA_32BIT_MASK	DMA_BIT_MASK(32)
-#define DMA_31BIT_MASK	DMA_BIT_MASK(31)
-#define DMA_30BIT_MASK	DMA_BIT_MASK(30)
-#define DMA_29BIT_MASK	DMA_BIT_MASK(29)
-#define DMA_28BIT_MASK	DMA_BIT_MASK(28)
-#define DMA_24BIT_MASK	DMA_BIT_MASK(24)
-
 #define DMA_MASK_NONE	0x0ULL
 
 static inline int valid_dma_direction(int dma_direction)
-- 
1.6.0.6


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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  5:14 [PATCH] remove DMA_nBIT_MASK macro FUJITA Tomonori
@ 2009-05-07  5:33 ` Yang Hongyang
  2009-05-07 11:18   ` Ingo Molnar
  2009-05-07  5:34 ` [PATCH] remove DMA_nBIT_MASK macro Andrew Morton
  1 sibling, 1 reply; 17+ messages in thread
From: Yang Hongyang @ 2009-05-07  5:33 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: akpm, linux-kernel, netdev, linux-arm-kernel, Ingo Molnar

FUJITA Tomonori wrote:
> We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
> we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?
> 
> As long as these macros exist, people use them. The current git has
> two users and linux-next have other users.
> 
> Is it better to remove DMA_nBIT_MASK macros completely now?
> 

CC:ingo

I have no objections,actually I used to remove all these defines in my
first commit of these patch series,but got suggestions that keep these
defines one more circle.Maybe it's time to remove these defines now or
to remove at the end of this circle?

Reviewed-by:yanghy@cn.fujitsu.com

> =
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] remove DMA_nBIT_MASK macros
> 
> This removes DMA_nBIT_MASK macros in dma-mapping.h so that we will not
> have any new users.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  arch/arm/mach-davinci/board-dm644x-evm.c |    4 ++--
>  drivers/net/igbvf/netdev.c               |   13 +++++++------
>  include/linux/dma-mapping.h              |   19 -------------------
>  3 files changed, 9 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
> index c039674..b2e7f9c 100644
> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> @@ -211,7 +211,7 @@ static struct resource ide_resources[] = {
>  	},
>  };
>  
> -static u64 ide_dma_mask = DMA_32BIT_MASK;
> +static u64 ide_dma_mask = DMA_BIT_MASK(32);
>  
>  static struct platform_device ide_dev = {
>  	.name           = "palm_bk3710",
> @@ -220,7 +220,7 @@ static struct platform_device ide_dev = {
>  	.num_resources  = ARRAY_SIZE(ide_resources),
>  	.dev = {
>  		.dma_mask		= &ide_dma_mask,
> -		.coherent_dma_mask      = DMA_32BIT_MASK,
> +		.coherent_dma_mask      = DMA_BIT_MASK(32),
>  	},
>  };
>  
> diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
> index b774666..c084d3b 100644
> --- a/drivers/net/igbvf/netdev.c
> +++ b/drivers/net/igbvf/netdev.c
> @@ -1279,7 +1279,7 @@ static void igbvf_configure_tx(struct igbvf_adapter *adapter)
>  	/* Setup the HW Tx Head and Tail descriptor pointers */
>  	ew32(TDLEN(0), tx_ring->count * sizeof(union e1000_adv_tx_desc));
>  	tdba = tx_ring->dma;
> -	ew32(TDBAL(0), (tdba & DMA_32BIT_MASK));
> +	ew32(TDBAL(0), (tdba & DMA_BIT_MASK(32)));
>  	ew32(TDBAH(0), (tdba >> 32));
>  	ew32(TDH(0), 0);
>  	ew32(TDT(0), 0);
> @@ -1365,7 +1365,7 @@ static void igbvf_configure_rx(struct igbvf_adapter *adapter)
>  	 * the Base and Length of the Rx Descriptor Ring
>  	 */
>  	rdba = rx_ring->dma;
> -	ew32(RDBAL(0), (rdba & DMA_32BIT_MASK));
> +	ew32(RDBAL(0), (rdba & DMA_BIT_MASK(32)));
>  	ew32(RDBAH(0), (rdba >> 32));
>  	ew32(RDLEN(0), rx_ring->count * sizeof(union e1000_adv_rx_desc));
>  	rx_ring->head = E1000_RDH(0);
> @@ -2637,15 +2637,16 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
>  		return err;
>  
>  	pci_using_dac = 0;
> -	err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
> +	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
>  	if (!err) {
> -		err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
> +		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
>  		if (!err)
>  			pci_using_dac = 1;
>  	} else {
> -		err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
> +		err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
>  		if (err) {
> -			err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
> +			err = pci_set_consistent_dma_mask(pdev,
> +							  DMA_BIT_MASK(32));
>  			if (err) {
>  				dev_err(&pdev->dev, "No usable DMA "
>  				        "configuration, aborting\n");
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 8083b6a..f56e607 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -63,25 +63,6 @@ struct dma_map_ops {
>  

Is it better to add a comment here to tell people that the old macro was deleted?

>  #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
>  
> -/*
> - * NOTE: do not use the below macros in new code and do not add new definitions
> - * here.
> - *
> - * Instead, just open-code DMA_BIT_MASK(n) within your driver
> - */
> -#define DMA_64BIT_MASK	DMA_BIT_MASK(64)
> -#define DMA_48BIT_MASK	DMA_BIT_MASK(48)
> -#define DMA_47BIT_MASK	DMA_BIT_MASK(47)
> -#define DMA_40BIT_MASK	DMA_BIT_MASK(40)
> -#define DMA_39BIT_MASK	DMA_BIT_MASK(39)
> -#define DMA_35BIT_MASK	DMA_BIT_MASK(35)
> -#define DMA_32BIT_MASK	DMA_BIT_MASK(32)
> -#define DMA_31BIT_MASK	DMA_BIT_MASK(31)
> -#define DMA_30BIT_MASK	DMA_BIT_MASK(30)
> -#define DMA_29BIT_MASK	DMA_BIT_MASK(29)
> -#define DMA_28BIT_MASK	DMA_BIT_MASK(28)
> -#define DMA_24BIT_MASK	DMA_BIT_MASK(24)
> -
>  #define DMA_MASK_NONE	0x0ULL
>  
>  static inline int valid_dma_direction(int dma_direction)


-- 
Regards
Yang Hongyang

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  5:14 [PATCH] remove DMA_nBIT_MASK macro FUJITA Tomonori
  2009-05-07  5:33 ` Yang Hongyang
@ 2009-05-07  5:34 ` Andrew Morton
  2009-05-07  8:29   ` Yang Hongyang
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Morton @ 2009-05-07  5:34 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: yanghy, linux-kernel, netdev, linux-arm-kernel

On Thu, 7 May 2009 14:14:16 +0900 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
> we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?
> 
> As long as these macros exist, people use them. The current git has
> two users and linux-next have other users.
> 
> Is it better to remove DMA_nBIT_MASK macros completely now?

Yes, the plan is to remove them.

Doing so will break lots and lots of out-of-tree drivers, causing
people some grief.  Is there any way in which we can cause their use to
cause __deprecated warnings for a couple of months, to give people a
chance to migrate?

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  5:34 ` [PATCH] remove DMA_nBIT_MASK macro Andrew Morton
@ 2009-05-07  8:29   ` Yang Hongyang
  2009-05-07  8:46     ` Jiri Slaby
  0 siblings, 1 reply; 17+ messages in thread
From: Yang Hongyang @ 2009-05-07  8:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: FUJITA Tomonori, linux-kernel, netdev, linux-arm-kernel

Andrew Morton wrote:
> On Thu, 7 May 2009 14:14:16 +0900 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> 
>> We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
>> we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?
>>
>> As long as these macros exist, people use them. The current git has
>> two users and linux-next have other users.
>>
>> Is it better to remove DMA_nBIT_MASK macros completely now?
> 
> Yes, the plan is to remove them.
> 
> Doing so will break lots and lots of out-of-tree drivers, causing
> people some grief.  Is there any way in which we can cause their use to
> cause __deprecated warnings for a couple of months, to give people a
> chance to migrate?
> 
> 

Shall we use something like below to warn people?
#define DMA_64BIT_MASK	DMA_BIT_MASK(64);(__deprecated warnings:use DMA_BIT_MASK(64) instead) ?

-- 
Regards
Yang Hongyang

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  8:29   ` Yang Hongyang
@ 2009-05-07  8:46     ` Jiri Slaby
  2009-05-07  8:59       ` Yang Hongyang
  2009-05-07 23:35       ` FUJITA Tomonori
  0 siblings, 2 replies; 17+ messages in thread
From: Jiri Slaby @ 2009-05-07  8:46 UTC (permalink / raw)
  To: Yang Hongyang
  Cc: Andrew Morton, FUJITA Tomonori, linux-kernel, netdev, linux-arm-kernel

On 05/07/2009 10:29 AM, Yang Hongyang wrote:
> Shall we use something like below to warn people?
> #define DMA_64BIT_MASK	DMA_BIT_MASK(64);(__deprecated warnings:use DMA_BIT_MASK(64) instead) ?

Something like an irq flags deprecation in the past:
http://lwn.net/Articles/229673/
?

I don't know how many in-initializer (struct x x = { DMA_64BIT_MASK } )
users are out there though.

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  8:46     ` Jiri Slaby
@ 2009-05-07  8:59       ` Yang Hongyang
  2009-05-07  9:03         ` Jiri Slaby
  2009-05-07 23:35       ` FUJITA Tomonori
  1 sibling, 1 reply; 17+ messages in thread
From: Yang Hongyang @ 2009-05-07  8:59 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Andrew Morton, FUJITA Tomonori, linux-kernel, netdev, linux-arm-kernel

Jiri Slaby wrote:
> On 05/07/2009 10:29 AM, Yang Hongyang wrote:
>> Shall we use something like below to warn people?
>> #define DMA_64BIT_MASK	DMA_BIT_MASK(64);(__deprecated warnings:use DMA_BIT_MASK(64) instead) ?
> 
> Something like an irq flags deprecation in the past:
> http://lwn.net/Articles/229673/
> ?

good catch,but this need to be modified (add one line is enough)to cause their use to
cause __deprecated warnings.

> 
> I don't know how many in-initializer (struct x x = { DMA_64BIT_MASK } )
> users are out there though.
> 
> 


-- 
Regards
Yang Hongyang

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  8:59       ` Yang Hongyang
@ 2009-05-07  9:03         ` Jiri Slaby
  0 siblings, 0 replies; 17+ messages in thread
From: Jiri Slaby @ 2009-05-07  9:03 UTC (permalink / raw)
  To: Yang Hongyang
  Cc: Andrew Morton, FUJITA Tomonori, linux-kernel, netdev, linux-arm-kernel

On 05/07/2009 10:59 AM, Yang Hongyang wrote:
> Jiri Slaby wrote:
>> Something like an irq flags deprecation in the past:
>> http://lwn.net/Articles/229673/
>> ?
> 
> good catch,but this need to be modified (add one line is enough)to cause their use to
> cause __deprecated warnings.

I'm lost, that inline does it, right?

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  5:33 ` Yang Hongyang
@ 2009-05-07 11:18   ` Ingo Molnar
  2009-05-07 23:35     ` FUJITA Tomonori
  2009-05-08  8:00     ` [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated Jiri Slaby
  0 siblings, 2 replies; 17+ messages in thread
From: Ingo Molnar @ 2009-05-07 11:18 UTC (permalink / raw)
  To: Yang Hongyang
  Cc: FUJITA Tomonori, akpm, linux-kernel, netdev, linux-arm-kernel


* Yang Hongyang <yanghy@cn.fujitsu.com> wrote:

> FUJITA Tomonori wrote:
> > We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
> > we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?
> > 
> > As long as these macros exist, people use them. The current git has
> > two users and linux-next have other users.
> > 
> > Is it better to remove DMA_nBIT_MASK macros completely now?

Can you see a way to emit build warnings? If yes then that might be 
a better solution instead of breaking in-the-pipeline code. We 
missed the upstream window of removing the facilities altogether, we 
could certainly do that in the next merge window though.

> CC:ingo
> 
> I have no objections,actually I used to remove all these defines in my
> first commit of these patch series,but got suggestions that keep these
> defines one more circle.Maybe it's time to remove these defines now or
> to remove at the end of this circle?
> 
> Reviewed-by:yanghy@cn.fujitsu.com

Thanks!

	Ingo

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07  8:46     ` Jiri Slaby
  2009-05-07  8:59       ` Yang Hongyang
@ 2009-05-07 23:35       ` FUJITA Tomonori
  1 sibling, 0 replies; 17+ messages in thread
From: FUJITA Tomonori @ 2009-05-07 23:35 UTC (permalink / raw)
  To: jirislaby
  Cc: yanghy, akpm, fujita.tomonori, linux-kernel, netdev, linux-arm-kernel

On Thu, 07 May 2009 10:46:09 +0200
Jiri Slaby <jirislaby@gmail.com> wrote:

> On 05/07/2009 10:29 AM, Yang Hongyang wrote:
> > Shall we use something like below to warn people?
> > #define DMA_64BIT_MASK	DMA_BIT_MASK(64);(__deprecated warnings:use DMA_BIT_MASK(64) instead) ?
> 
> Something like an irq flags deprecation in the past:
> http://lwn.net/Articles/229673/
> ?
> 
> I don't know how many in-initializer (struct x x = { DMA_64BIT_MASK } )
> users are out there though.

Unfortunately, there are lots. Converting these macros to functions
would breaks drivers too.

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

* Re: [PATCH] remove DMA_nBIT_MASK macro
  2009-05-07 11:18   ` Ingo Molnar
@ 2009-05-07 23:35     ` FUJITA Tomonori
  2009-05-08  8:00     ` [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated Jiri Slaby
  1 sibling, 0 replies; 17+ messages in thread
From: FUJITA Tomonori @ 2009-05-07 23:35 UTC (permalink / raw)
  To: mingo
  Cc: yanghy, fujita.tomonori, akpm, linux-kernel, netdev, linux-arm-kernel

On Thu, 7 May 2009 13:18:46 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
> 
> > FUJITA Tomonori wrote:
> > > We replaced all DMA_nBIT_MASK macros with DMA_BIT_MASK(n) but why do
> > > we still keep DMA_nBIT_MASK macros in include/linux/dma-mapping.h?
> > > 
> > > As long as these macros exist, people use them. The current git has
> > > two users and linux-next have other users.
> > > 
> > > Is it better to remove DMA_nBIT_MASK macros completely now?
> 
> Can you see a way to emit build warnings? If yes then that might be 
> a better solution instead of breaking in-the-pipeline code.

Unfortunately, no. Since 2.6.24, include/linux/dma-mapping.h has the
warning:

/*
 * NOTE: do not use the below macros in new code and do not add new definitions
 * here.
 *
 * Instead, just open-code DMA_BIT_MASK(n) within your driver
 */

IMO, we give people enough time for migration.


> We missed the upstream window of removing the facilities altogether,
> we could certainly do that in the next merge window though.

Can you apply this patch to the tip? I want to have this patch in
linux-next to let new users of DMA-nBIT_MASK in linux-next know that
they use wrong macros.

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

* [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated
  2009-05-07 11:18   ` Ingo Molnar
  2009-05-07 23:35     ` FUJITA Tomonori
@ 2009-05-08  8:00     ` Jiri Slaby
  2009-05-09 23:55       ` FUJITA Tomonori
  2009-05-11 12:48       ` [tip:core/iommu] dma-mapping.h: mark DMA_nBITS_MASK as deprecated tip-bot for Jiri Slaby
  1 sibling, 2 replies; 17+ messages in thread
From: Jiri Slaby @ 2009-05-08  8:00 UTC (permalink / raw)
  To: mingo; +Cc: yanghy, akpm, fujita.tomonori, netdev, linux-kernel, Jiri Slaby

Ingo Molnar <mingo@elte.hu> wrote:
> Can you see a way to emit build warnings? If yes then that might be 
> a better solution instead of breaking in-the-pipeline code.

What about this:
--

Mark them deprecated so that 3rd party vendors get notified about that
before their modules break by removing those macros later.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 include/linux/dma-mapping.h |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 8083b6a..6bf3339 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -63,24 +63,26 @@ struct dma_map_ops {
 
 #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
+typedef u64 DMA_DEPRECATED __deprecated;
+
 /*
  * NOTE: do not use the below macros in new code and do not add new definitions
  * here.
  *
  * Instead, just open-code DMA_BIT_MASK(n) within your driver
  */
-#define DMA_64BIT_MASK	DMA_BIT_MASK(64)
-#define DMA_48BIT_MASK	DMA_BIT_MASK(48)
-#define DMA_47BIT_MASK	DMA_BIT_MASK(47)
-#define DMA_40BIT_MASK	DMA_BIT_MASK(40)
-#define DMA_39BIT_MASK	DMA_BIT_MASK(39)
-#define DMA_35BIT_MASK	DMA_BIT_MASK(35)
-#define DMA_32BIT_MASK	DMA_BIT_MASK(32)
-#define DMA_31BIT_MASK	DMA_BIT_MASK(31)
-#define DMA_30BIT_MASK	DMA_BIT_MASK(30)
-#define DMA_29BIT_MASK	DMA_BIT_MASK(29)
-#define DMA_28BIT_MASK	DMA_BIT_MASK(28)
-#define DMA_24BIT_MASK	DMA_BIT_MASK(24)
+#define DMA_64BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(48)
+#define DMA_47BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(47)
+#define DMA_40BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(40)
+#define DMA_39BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(39)
+#define DMA_35BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(35)
+#define DMA_32BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(32)
+#define DMA_31BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(31)
+#define DMA_30BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(30)
+#define DMA_29BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(29)
+#define DMA_28BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(28)
+#define DMA_24BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(24)
 
 #define DMA_MASK_NONE	0x0ULL
 
-- 
1.6.2.4


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

* Re: [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated
  2009-05-08  8:00     ` [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated Jiri Slaby
@ 2009-05-09 23:55       ` FUJITA Tomonori
  2009-05-10  7:04         ` [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix Jiri Slaby
  2009-05-11 12:48       ` [tip:core/iommu] dma-mapping.h: mark DMA_nBITS_MASK as deprecated tip-bot for Jiri Slaby
  1 sibling, 1 reply; 17+ messages in thread
From: FUJITA Tomonori @ 2009-05-09 23:55 UTC (permalink / raw)
  To: jirislaby; +Cc: mingo, yanghy, akpm, fujita.tomonori, netdev, linux-kernel

On Fri,  8 May 2009 10:00:38 +0200
Jiri Slaby <jirislaby@gmail.com> wrote:

> Ingo Molnar <mingo@elte.hu> wrote:
> > Can you see a way to emit build warnings? If yes then that might be 
> > a better solution instead of breaking in-the-pipeline code.
> 
> What about this:
> --
> 
> Mark them deprecated so that 3rd party vendors get notified about that
> before their modules break by removing those macros later.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> ---
>  include/linux/dma-mapping.h |   26 ++++++++++++++------------
>  1 files changed, 14 insertions(+), 12 deletions(-)

Ah, nice magic!

Well, "warning: 'DMA_DEPRECATED' is deprecated" warning message is a
bit obscure but the developers should notice that they do something
wrong.

Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>


Thanks a lot,

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

* [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix
  2009-05-09 23:55       ` FUJITA Tomonori
@ 2009-05-10  7:04         ` Jiri Slaby
  2009-05-11  2:36           ` FUJITA Tomonori
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri Slaby @ 2009-05-10  7:04 UTC (permalink / raw)
  To: mingo; +Cc: yanghy, akpm, fujita.tomonori, netdev, linux-kernel, Jiri Slaby

Andrew, please fold into
dma-mapping: mark DMA_nBITS_MASK as deprecated
--

As Fujita correctly demurs, use more meaningful typedef name, so that we
now see:
warning: DMA_nnBIT_MASK is deprecated
instead of
warning: DMA_DEPRECATED is deprecated

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Ingo Molnar <mingo@elte.hu>
---
 include/linux/dma-mapping.h |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 6bf3339..38f5608 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -63,7 +63,7 @@ struct dma_map_ops {
 
 #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
-typedef u64 DMA_DEPRECATED __deprecated;
+typedef u64 DMA_nnBIT_MASK __deprecated;
 
 /*
  * NOTE: do not use the below macros in new code and do not add new definitions
@@ -71,18 +71,18 @@ typedef u64 DMA_DEPRECATED __deprecated;
  *
  * Instead, just open-code DMA_BIT_MASK(n) within your driver
  */
-#define DMA_64BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(64)
-#define DMA_48BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(48)
-#define DMA_47BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(47)
-#define DMA_40BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(40)
-#define DMA_39BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(39)
-#define DMA_35BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(35)
-#define DMA_32BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(32)
-#define DMA_31BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(31)
-#define DMA_30BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(30)
-#define DMA_29BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(29)
-#define DMA_28BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(28)
-#define DMA_24BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(24)
+#define DMA_64BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(48)
+#define DMA_47BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(47)
+#define DMA_40BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(40)
+#define DMA_39BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(39)
+#define DMA_35BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(35)
+#define DMA_32BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(32)
+#define DMA_31BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(31)
+#define DMA_30BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(30)
+#define DMA_29BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(29)
+#define DMA_28BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(28)
+#define DMA_24BIT_MASK	(DMA_nnBIT_MASK)DMA_BIT_MASK(24)
 
 #define DMA_MASK_NONE	0x0ULL
 
-- 
1.6.2.4


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

* Re: [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix
  2009-05-10  7:04         ` [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix Jiri Slaby
@ 2009-05-11  2:36           ` FUJITA Tomonori
  2009-05-11  9:21             ` Jiri Slaby
  0 siblings, 1 reply; 17+ messages in thread
From: FUJITA Tomonori @ 2009-05-11  2:36 UTC (permalink / raw)
  To: jirislaby; +Cc: mingo, yanghy, akpm, fujita.tomonori, netdev, linux-kernel

On Sun, 10 May 2009 09:04:26 +0200
Jiri Slaby <jirislaby@gmail.com> wrote:

> Andrew, please fold into
> dma-mapping: mark DMA_nBITS_MASK as deprecated
> --
> 
> As Fujita correctly demurs, use more meaningful typedef name, so that we
> now see:
> warning: DMA_nnBIT_MASK is deprecated
> instead of
> warning: DMA_DEPRECATED is deprecated
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
>  include/linux/dma-mapping.h |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)

Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>


But I think that you need to resend a version of this patch against
tip. We need this patch in linux-next to warn some new users of these
deprecated macros.

Thanks,

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

* Re: [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix
  2009-05-11  2:36           ` FUJITA Tomonori
@ 2009-05-11  9:21             ` Jiri Slaby
  2009-05-11 12:46               ` Ingo Molnar
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri Slaby @ 2009-05-11  9:21 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: mingo, yanghy, akpm, netdev, linux-kernel

On 05/11/2009 04:36 AM, FUJITA Tomonori wrote:
> But I think that you need to resend a version of this patch against
> tip. We need this patch in linux-next to warn some new users of these
> deprecated macros.

It depends on Ingo if he doesn't mind to pick it up :).

Anyway I though we want to merge this upstream for 1-2 releases and then
wave and tell it goodbye to propagate not only to linux-next users. I
would resend the patch with an entry in features removal schedule in
that case. But it's up to you...

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

* Re: [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix
  2009-05-11  9:21             ` Jiri Slaby
@ 2009-05-11 12:46               ` Ingo Molnar
  0 siblings, 0 replies; 17+ messages in thread
From: Ingo Molnar @ 2009-05-11 12:46 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: FUJITA Tomonori, yanghy, akpm, netdev, linux-kernel


* Jiri Slaby <jirislaby@gmail.com> wrote:

> On 05/11/2009 04:36 AM, FUJITA Tomonori wrote:
> > But I think that you need to resend a version of this patch against
> > tip. We need this patch in linux-next to warn some new users of these
> > deprecated macros.
> 
> It depends on Ingo if he doesn't mind to pick it up :).

Yes, i picked it up - dma-mapping.h changes generally get reviewed 
by and go via the IOMMU folks and is maintained in tip:core/iommu.

	Ingo

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

* [tip:core/iommu] dma-mapping.h: mark DMA_nBITS_MASK as deprecated
  2009-05-08  8:00     ` [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated Jiri Slaby
  2009-05-09 23:55       ` FUJITA Tomonori
@ 2009-05-11 12:48       ` tip-bot for Jiri Slaby
  1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for Jiri Slaby @ 2009-05-11 12:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fujita.tomonori, jirislaby, tglx, mingo

Commit-ID:  0802bbd72dbc0e285799258efbf99e2e822ad8cb
Gitweb:     http://git.kernel.org/tip/0802bbd72dbc0e285799258efbf99e2e822ad8cb
Author:     Jiri Slaby <jirislaby@gmail.com>
AuthorDate: Fri, 8 May 2009 10:00:38 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 11 May 2009 14:45:43 +0200

dma-mapping.h: mark DMA_nBITS_MASK as deprecated

Mark them deprecated so that 3rd party vendors get notified about that
before their modules break by removing those macros later.

[ Impact: trigger cleanups by emitting deprecation messages ]

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: yanghy@cn.fujitsu.com
Cc: akpm@linux-foundation.org
LKML-Reference: <1241769638-27301-1-git-send-email-jirislaby@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 include/linux/dma-mapping.h |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 8083b6a..6bf3339 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -63,24 +63,26 @@ struct dma_map_ops {
 
 #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
+typedef u64 DMA_DEPRECATED __deprecated;
+
 /*
  * NOTE: do not use the below macros in new code and do not add new definitions
  * here.
  *
  * Instead, just open-code DMA_BIT_MASK(n) within your driver
  */
-#define DMA_64BIT_MASK	DMA_BIT_MASK(64)
-#define DMA_48BIT_MASK	DMA_BIT_MASK(48)
-#define DMA_47BIT_MASK	DMA_BIT_MASK(47)
-#define DMA_40BIT_MASK	DMA_BIT_MASK(40)
-#define DMA_39BIT_MASK	DMA_BIT_MASK(39)
-#define DMA_35BIT_MASK	DMA_BIT_MASK(35)
-#define DMA_32BIT_MASK	DMA_BIT_MASK(32)
-#define DMA_31BIT_MASK	DMA_BIT_MASK(31)
-#define DMA_30BIT_MASK	DMA_BIT_MASK(30)
-#define DMA_29BIT_MASK	DMA_BIT_MASK(29)
-#define DMA_28BIT_MASK	DMA_BIT_MASK(28)
-#define DMA_24BIT_MASK	DMA_BIT_MASK(24)
+#define DMA_64BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(48)
+#define DMA_47BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(47)
+#define DMA_40BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(40)
+#define DMA_39BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(39)
+#define DMA_35BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(35)
+#define DMA_32BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(32)
+#define DMA_31BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(31)
+#define DMA_30BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(30)
+#define DMA_29BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(29)
+#define DMA_28BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(28)
+#define DMA_24BIT_MASK	(DMA_DEPRECATED)DMA_BIT_MASK(24)
 
 #define DMA_MASK_NONE	0x0ULL
 

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

end of thread, other threads:[~2009-05-11 12:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-07  5:14 [PATCH] remove DMA_nBIT_MASK macro FUJITA Tomonori
2009-05-07  5:33 ` Yang Hongyang
2009-05-07 11:18   ` Ingo Molnar
2009-05-07 23:35     ` FUJITA Tomonori
2009-05-08  8:00     ` [PATCH 1/1] DMA: mark DMA_nBITS_MASK as deprecated Jiri Slaby
2009-05-09 23:55       ` FUJITA Tomonori
2009-05-10  7:04         ` [PATCH 1/1] dma-mapping: mark DMA_nBITS_MASK as deprecated fix Jiri Slaby
2009-05-11  2:36           ` FUJITA Tomonori
2009-05-11  9:21             ` Jiri Slaby
2009-05-11 12:46               ` Ingo Molnar
2009-05-11 12:48       ` [tip:core/iommu] dma-mapping.h: mark DMA_nBITS_MASK as deprecated tip-bot for Jiri Slaby
2009-05-07  5:34 ` [PATCH] remove DMA_nBIT_MASK macro Andrew Morton
2009-05-07  8:29   ` Yang Hongyang
2009-05-07  8:46     ` Jiri Slaby
2009-05-07  8:59       ` Yang Hongyang
2009-05-07  9:03         ` Jiri Slaby
2009-05-07 23:35       ` FUJITA Tomonori

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.