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.
>
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
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
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,
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
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
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
"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:
>
>
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
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 :
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
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?):
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
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
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?):
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,
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 :
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
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
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
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
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
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
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
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
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
26 matches
Mail list logo