Re: [PATCH] bitops: move BITS() macro to the bitops file

2013-08-07 Thread Borislav Petkov
On Wed, Aug 07, 2013 at 11:06:19AM +0200, Linus Walleij wrote: > This macro was invented by Mattias Nilsson for the usecase > where you want to set a sequence of bits inside a n-bit > word, while leaving the head and tail of the sequence all > zeroes. For example: > > #include > > u16 mask =

Re: [PATCH] bitops: move BITS() macro to the bitops file

2013-08-07 Thread Joe Perches
On Wed, 2013-08-07 at 11:06 +0200, Linus Walleij wrote: > This macro was invented by Mattias Nilsson for the usecase > where you want to set a sequence of bits inside a n-bit > word, while leaving the head and tail of the sequence all > zeroes. For example: > > #include BITS is a name that's n

Re: [PATCH] bitops: move BITS() macro to the bitops file

2013-08-07 Thread anish singh
On Wed, Aug 7, 2013 at 2:36 PM, Linus Walleij wrote: > This macro was invented by Mattias Nilsson for the usecase > where you want to set a sequence of bits inside a n-bit > word, while leaving the head and tail of the sequence all > zeroes. For example: > > #include > > u16 mask = BITS(4, 12

[PATCH] bitops: move BITS() macro to the bitops file

2013-08-07 Thread Linus Walleij
This macro was invented by Mattias Nilsson for the usecase where you want to set a sequence of bits inside a n-bit word, while leaving the head and tail of the sequence all zeroes. For example: #include u16 mask = BITS(4, 12); Yields a mask like this: 0001 This patch moves t