Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-06 Thread Borislav Petkov
On Fri, Oct 05, 2007 at 02:00:50PM -0700, Andrew Morton wrote: > On Fri, 05 Oct 2007 13:43:54 -0700 > Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > > > Andrew Morton wrote: > > > From: Andrew Morton <[EMAIL PROTECTED]> > > > > > > Now that we have DMA_BIT_MASK(), these macros are pointless. >

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-06 Thread Borislav Petkov
On Fri, Oct 05, 2007 at 02:23:41PM -0700, Jeremy Fitzhardinge wrote: > Robert P. J. Day wrote: > > or you could take advantage of the macros in kernel.h and write that > > as: > > > > +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX : ((1ULL<<(n))-1)) > > > > But that's a more indirect

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-06 Thread Borislav Petkov
On Fri, Oct 05, 2007 at 02:23:41PM -0700, Jeremy Fitzhardinge wrote: Robert P. J. Day wrote: or you could take advantage of the macros in kernel.h and write that as: +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX : ((1ULL(n))-1)) But that's a more indirect way of

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-06 Thread Borislav Petkov
On Fri, Oct 05, 2007 at 02:00:50PM -0700, Andrew Morton wrote: On Fri, 05 Oct 2007 13:43:54 -0700 Jeremy Fitzhardinge [EMAIL PROTECTED] wrote: Andrew Morton wrote: From: Andrew Morton [EMAIL PROTECTED] Now that we have DMA_BIT_MASK(), these macros are pointless. Except,

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andrew Morton wrote: > Well yes, but DMA_BIT_MASK(0) invokes undefined behaviour, generates a > compiler warning and evaluates to 0x (with my setup). > > That won't be a problem in practice, but it is strictly wrong and doesn't set > a good exmaple for the children ;) > It's

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Fri, 05 Oct 2007 14:28:45 -0700 Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > Andreas Schwab wrote: > > #define DMA_BIT_MASK(n) ((u64)-1 >> (64 - (n))) > > > > Yeah, that's cleaner. > Well yes, but DMA_BIT_MASK(0) invokes undefined behaviour, generates a compiler warning and

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andreas Schwab wrote: > #define DMA_BIT_MASK(n) ((u64)-1 >> (64 - (n))) > Yeah, that's cleaner. 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

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andreas Schwab
"Robert P. J. Day" <[EMAIL PROTECTED]> writes: > On Fri, 5 Oct 2007, Andrew Morton wrote: > >> -#define DMA_BIT_MASK(n) ((1ULL<<(n))-1) >> +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) > > or you could take advantage of the macros in kernel.h and write that > as: > >

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Robert P. J. Day wrote: > or you could take advantage of the macros in kernel.h and write that > as: > > +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX : ((1ULL<<(n))-1)) > But that's a more indirect way of expressing "I want all 1's". J - To unsubscribe from this list: send the

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Robert P. J. Day
On Fri, 5 Oct 2007, Andrew Morton wrote: > -#define DMA_BIT_MASK(n) ((1ULL<<(n))-1) > +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) or you could take advantage of the macros in kernel.h and write that as: +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX :

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Fri, 05 Oct 2007 13:43:54 -0700 Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > From: Andrew Morton <[EMAIL PROTECTED]> > > > > Now that we have DMA_BIT_MASK(), these macros are pointless. > > > > Except, unfortunately, DMA_64BIT_MASK. I guess we could special

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andrew Morton wrote: > From: Andrew Morton <[EMAIL PROTECTED]> > > Now that we have DMA_BIT_MASK(), these macros are pointless. > Except, unfortunately, DMA_64BIT_MASK. I guess we could special case it, assuming this works in all the contexts the macro is used in (ie, compile-time constant?):

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Tue, 18 Sep 2007 21:46:47 +0200 Borislav Petkov <[EMAIL PROTECTED]> wrote: > These patches remove redundant DMA_..BIT_MASK definitions across two > drivers. The computation of the majority of the bitmasks is done by the > compiler. The initial split of the patch touching each a different file

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Tue, 18 Sep 2007 21:46:47 +0200 Borislav Petkov [EMAIL PROTECTED] wrote: These patches remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andrew Morton wrote: From: Andrew Morton [EMAIL PROTECTED] Now that we have DMA_BIT_MASK(), these macros are pointless. Except, unfortunately, DMA_64BIT_MASK. I guess we could special case it, assuming this works in all the contexts the macro is used in (ie, compile-time constant?):

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Fri, 05 Oct 2007 13:43:54 -0700 Jeremy Fitzhardinge [EMAIL PROTECTED] wrote: Andrew Morton wrote: From: Andrew Morton [EMAIL PROTECTED] Now that we have DMA_BIT_MASK(), these macros are pointless. Except, unfortunately, DMA_64BIT_MASK. I guess we could special case it,

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Robert P. J. Day
On Fri, 5 Oct 2007, Andrew Morton wrote: -#define DMA_BIT_MASK(n) ((1ULL(n))-1) +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL(n))-1)) or you could take advantage of the macros in kernel.h and write that as: +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX :

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Robert P. J. Day wrote: or you could take advantage of the macros in kernel.h and write that as: +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX : ((1ULL(n))-1)) But that's a more indirect way of expressing I want all 1's. J - To unsubscribe from this list: send the line

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andreas Schwab
Robert P. J. Day [EMAIL PROTECTED] writes: On Fri, 5 Oct 2007, Andrew Morton wrote: -#define DMA_BIT_MASK(n) ((1ULL(n))-1) +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL(n))-1)) or you could take advantage of the macros in kernel.h and write that as: +#define

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andreas Schwab wrote: #define DMA_BIT_MASK(n) ((u64)-1 (64 - (n))) Yeah, that's cleaner. 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

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Andrew Morton
On Fri, 05 Oct 2007 14:28:45 -0700 Jeremy Fitzhardinge [EMAIL PROTECTED] wrote: Andreas Schwab wrote: #define DMA_BIT_MASK(n) ((u64)-1 (64 - (n))) Yeah, that's cleaner. Well yes, but DMA_BIT_MASK(0) invokes undefined behaviour, generates a compiler warning and evaluates to

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-10-05 Thread Jeremy Fitzhardinge
Andrew Morton wrote: Well yes, but DMA_BIT_MASK(0) invokes undefined behaviour, generates a compiler warning and evaluates to 0x (with my setup). That won't be a problem in practice, but it is strictly wrong and doesn't set a good exmaple for the children ;) It's

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-09-19 Thread Satyam Sharma
On Tue, 18 Sep 2007, Borislav Petkov wrote: > > These patches remove redundant DMA_..BIT_MASK definitions across two > drivers. The computation of the majority of the bitmasks is done by the > compiler. The initial split of the patch touching each a different file got > removed due to possible

Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-09-19 Thread Satyam Sharma
On Tue, 18 Sep 2007, Borislav Petkov wrote: These patches remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got removed due to possible git

[PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-09-18 Thread Borislav Petkov
These patches remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got removed due to possible git bisect breakage. Andrew, can you please apply this

[PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

2007-09-18 Thread Borislav Petkov
These patches remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got removed due to possible git bisect breakage. Andrew, can you please apply this