Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Borislav Petkov
On Tue, Sep 18, 2007 at 11:46:40AM +0530, Satyam Sharma wrote:
> Hi Borislav,
> 
> 
> On Tue, 18 Sep 2007, Borislav Petkov wrote:
> 
> > On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
> > > Muli Ben-Yehuda wrote:
> > > >> +#define DMA_64BIT_MASKDMA_BIT_MASK(64)
> > > >> 
> > > >
> > > > This one does not do what you mean. You need an explicit mask or a
> > > > ~0ULL here.
> > > 
> > > Yeah, I was just about to comment on it.  Its possible the compiler
> > > might decide to shift by x%64 = 0.
> > > 
> > > J
> > ups, i knew that this might be a corner/boundary case. Thanks, updated 
> > patches
> > follow...
> 
> Please fold all three patches into a single patch in the updated series,
> otherwise git bisecters falling in between these patches will see the
> "redefinition ... previous definition was here" warnings of gcc ...

Will do later today, thanks.
-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Satyam Sharma
Hi Borislav,


On Tue, 18 Sep 2007, Borislav Petkov wrote:

> On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
> > Muli Ben-Yehuda wrote:
> > >> +#define DMA_64BIT_MASK  DMA_BIT_MASK(64)
> > >> 
> > >
> > > This one does not do what you mean. You need an explicit mask or a
> > > ~0ULL here.
> > 
> > Yeah, I was just about to comment on it.  Its possible the compiler
> > might decide to shift by x%64 = 0.
> > 
> > J
> ups, i knew that this might be a corner/boundary case. Thanks, updated patches
> follow...

Please fold all three patches into a single patch in the updated series,
otherwise git bisecters falling in between these patches will see the
"redefinition ... previous definition was here" warnings of gcc ...


Satyam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Borislav Petkov
On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
> Muli Ben-Yehuda wrote:
> >> +#define DMA_64BIT_MASKDMA_BIT_MASK(64)
> >> 
> >
> > This one does not do what you mean. You need an explicit mask or a
> > ~0ULL here.
> 
> Yeah, I was just about to comment on it.  Its possible the compiler
> might decide to shift by x%64 = 0.
> 
> J
ups, i knew that this might be a corner/boundary case. Thanks, updated patches
follow...
-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Jeremy Fitzhardinge
Muli Ben-Yehuda wrote:
>> +#define DMA_64BIT_MASK  DMA_BIT_MASK(64)
>> 
>
> This one does not do what you mean. You need an explicit mask or a
> ~0ULL here.

Yeah, I was just about to comment on it.  Its possible the compiler
might decide to shift by x%64 = 0.

J

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


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Jeremy Fitzhardinge
Muli Ben-Yehuda wrote:
 +#define DMA_64BIT_MASK  DMA_BIT_MASK(64)
 

 This one does not do what you mean. You need an explicit mask or a
 ~0ULL here.

Yeah, I was just about to comment on it.  Its possible the compiler
might decide to shift by x%64 = 0.

J

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Borislav Petkov
On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
 Muli Ben-Yehuda wrote:
  +#define DMA_64BIT_MASKDMA_BIT_MASK(64)
  
 
  This one does not do what you mean. You need an explicit mask or a
  ~0ULL here.
 
 Yeah, I was just about to comment on it.  Its possible the compiler
 might decide to shift by x%64 = 0.
 
 J
ups, i knew that this might be a corner/boundary case. Thanks, updated patches
follow...
-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Satyam Sharma
Hi Borislav,


On Tue, 18 Sep 2007, Borislav Petkov wrote:

 On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
  Muli Ben-Yehuda wrote:
   +#define DMA_64BIT_MASK  DMA_BIT_MASK(64)
   
  
   This one does not do what you mean. You need an explicit mask or a
   ~0ULL here.
  
  Yeah, I was just about to comment on it.  Its possible the compiler
  might decide to shift by x%64 = 0.
  
  J
 ups, i knew that this might be a corner/boundary case. Thanks, updated patches
 follow...

Please fold all three patches into a single patch in the updated series,
otherwise git bisecters falling in between these patches will see the
redefinition ... previous definition was here warnings of gcc ...


Satyam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-18 Thread Borislav Petkov
On Tue, Sep 18, 2007 at 11:46:40AM +0530, Satyam Sharma wrote:
 Hi Borislav,
 
 
 On Tue, 18 Sep 2007, Borislav Petkov wrote:
 
  On Mon, Sep 17, 2007 at 11:01:21PM -0700, Jeremy Fitzhardinge wrote:
   Muli Ben-Yehuda wrote:
+#define DMA_64BIT_MASKDMA_BIT_MASK(64)

   
This one does not do what you mean. You need an explicit mask or a
~0ULL here.
   
   Yeah, I was just about to comment on it.  Its possible the compiler
   might decide to shift by x%64 = 0.
   
   J
  ups, i knew that this might be a corner/boundary case. Thanks, updated 
  patches
  follow...
 
 Please fold all three patches into a single patch in the updated series,
 otherwise git bisecters falling in between these patches will see the
 redefinition ... previous definition was here warnings of gcc ...

Will do later today, thanks.
-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-17 Thread Muli Ben-Yehuda
On Tue, Sep 18, 2007 at 06:29:19AM +0200, Borislav Petkov wrote:
> These patches remove redundant DMA_..BIT_MASK definitions across two drivers.
> In this version of the patches, the computation of the bitmasks is done by
> the compiler.
> 
> Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
> Cc: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
> 
> --
> Index: 23-rc6/include/linux/dma-mapping.h
> ===
> --- 23-rc6/include/linux/dma-mapping.h.orig   2007-09-17 17:48:20.0 
> +0200
> +++ 23-rc6/include/linux/dma-mapping.h2007-09-18 06:12:33.0 
> +0200
> @@ -13,16 +13,19 @@
>   DMA_NONE = 3,
>  };
>  
> -#define DMA_64BIT_MASK   0xULL
> -#define DMA_48BIT_MASK   0xULL
> -#define DMA_40BIT_MASK   0x00ffULL
> -#define DMA_39BIT_MASK   0x007fULL
> -#define DMA_32BIT_MASK   0xULL
> -#define DMA_31BIT_MASK   0x7fffULL
> -#define DMA_30BIT_MASK   0x3fffULL
> -#define DMA_29BIT_MASK   0x1fffULL
> -#define DMA_28BIT_MASK   0x0fffULL
> -#define DMA_24BIT_MASK   0x00ffULL
> +#define DMA_BIT_MASK(n)  ((1ULL<<(n))-1)
> +
> +#define DMA_64BIT_MASK   DMA_BIT_MASK(64)

This one does not do what you mean. You need an explicit mask or a
~0ULL here.

Cheers,
Muli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-17 Thread Borislav Petkov
These patches remove redundant DMA_..BIT_MASK definitions across two drivers.
In this version of the patches, the computation of the bitmasks is done by
the compiler.

Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
Cc: Jeremy Fitzhardinge <[EMAIL PROTECTED]>

--
Index: 23-rc6/include/linux/dma-mapping.h
===
--- 23-rc6/include/linux/dma-mapping.h.orig 2007-09-17 17:48:20.0 
+0200
+++ 23-rc6/include/linux/dma-mapping.h  2007-09-18 06:12:33.0 +0200
@@ -13,16 +13,19 @@
DMA_NONE = 3,
 };
 
-#define DMA_64BIT_MASK 0xULL
-#define DMA_48BIT_MASK 0xULL
-#define DMA_40BIT_MASK 0x00ffULL
-#define DMA_39BIT_MASK 0x007fULL
-#define DMA_32BIT_MASK 0xULL
-#define DMA_31BIT_MASK 0x7fffULL
-#define DMA_30BIT_MASK 0x3fffULL
-#define DMA_29BIT_MASK 0x1fffULL
-#define DMA_28BIT_MASK 0x0fffULL
-#define DMA_24BIT_MASK 0x00ffULL
+#define DMA_BIT_MASK(n)((1ULL<<(n))-1)
+
+#define DMA_64BIT_MASK DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK DMA_BIT_MASK(48)
+#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)
 
 static inline int valid_dma_direction(int dma_direction)
 {

-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-17 Thread Borislav Petkov
These patches remove redundant DMA_..BIT_MASK definitions across two drivers.
In this version of the patches, the computation of the bitmasks is done by
the compiler.

Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
Cc: Jeremy Fitzhardinge [EMAIL PROTECTED]

--
Index: 23-rc6/include/linux/dma-mapping.h
===
--- 23-rc6/include/linux/dma-mapping.h.orig 2007-09-17 17:48:20.0 
+0200
+++ 23-rc6/include/linux/dma-mapping.h  2007-09-18 06:12:33.0 +0200
@@ -13,16 +13,19 @@
DMA_NONE = 3,
 };
 
-#define DMA_64BIT_MASK 0xULL
-#define DMA_48BIT_MASK 0xULL
-#define DMA_40BIT_MASK 0x00ffULL
-#define DMA_39BIT_MASK 0x007fULL
-#define DMA_32BIT_MASK 0xULL
-#define DMA_31BIT_MASK 0x7fffULL
-#define DMA_30BIT_MASK 0x3fffULL
-#define DMA_29BIT_MASK 0x1fffULL
-#define DMA_28BIT_MASK 0x0fffULL
-#define DMA_24BIT_MASK 0x00ffULL
+#define DMA_BIT_MASK(n)((1ULL(n))-1)
+
+#define DMA_64BIT_MASK DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK DMA_BIT_MASK(48)
+#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)
 
 static inline int valid_dma_direction(int dma_direction)
 {

-- 
Regards/Gruß,
Boris.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1

2007-09-17 Thread Muli Ben-Yehuda
On Tue, Sep 18, 2007 at 06:29:19AM +0200, Borislav Petkov wrote:
 These patches remove redundant DMA_..BIT_MASK definitions across two drivers.
 In this version of the patches, the computation of the bitmasks is done by
 the compiler.
 
 Signed-off-by: Borislav Petkov [EMAIL PROTECTED]
 Cc: Jeremy Fitzhardinge [EMAIL PROTECTED]
 
 --
 Index: 23-rc6/include/linux/dma-mapping.h
 ===
 --- 23-rc6/include/linux/dma-mapping.h.orig   2007-09-17 17:48:20.0 
 +0200
 +++ 23-rc6/include/linux/dma-mapping.h2007-09-18 06:12:33.0 
 +0200
 @@ -13,16 +13,19 @@
   DMA_NONE = 3,
  };
  
 -#define DMA_64BIT_MASK   0xULL
 -#define DMA_48BIT_MASK   0xULL
 -#define DMA_40BIT_MASK   0x00ffULL
 -#define DMA_39BIT_MASK   0x007fULL
 -#define DMA_32BIT_MASK   0xULL
 -#define DMA_31BIT_MASK   0x7fffULL
 -#define DMA_30BIT_MASK   0x3fffULL
 -#define DMA_29BIT_MASK   0x1fffULL
 -#define DMA_28BIT_MASK   0x0fffULL
 -#define DMA_24BIT_MASK   0x00ffULL
 +#define DMA_BIT_MASK(n)  ((1ULL(n))-1)
 +
 +#define DMA_64BIT_MASK   DMA_BIT_MASK(64)

This one does not do what you mean. You need an explicit mask or a
~0ULL here.

Cheers,
Muli
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/