diff mbox

[v1,5/6] bitops: Introduce BIT_ULL

Message ID 1379606435-15871-6-git-send-email-srinivas.pandruvada@linux.intel.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Srinivas Pandruvada Sept. 19, 2013, 4 p.m. UTC
Adding BIT(x) equivalent for unsigned long long type, BIT_ULL(x).

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 include/linux/bitops.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Borislav Petkov Sept. 19, 2013, 4:48 p.m. UTC | #1
On Thu, Sep 19, 2013 at 09:00:34AM -0700, Srinivas Pandruvada wrote:
> Adding BIT(x) equivalent for unsigned long long type, BIT_ULL(x).
> 
> Suggested-by: Joe Perches <joe@perches.com>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  include/linux/bitops.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/bitops.h b/include/linux/bitops.h
> index a3b6b82..34e9e94 100644
> --- a/include/linux/bitops.h
> +++ b/include/linux/bitops.h
> @@ -4,6 +4,7 @@
>  
>  #ifdef	__KERNEL__
>  #define BIT(nr)			(1UL << (nr))
> +#define BIT_ULL(nr)		(1ULL << (nr))

We already have BIT_64 for that.
Srinivas Pandruvada Sept. 19, 2013, 5:07 p.m. UTC | #2
On 09/19/2013 09:48 AM, Borislav Petkov wrote:
> On Thu, Sep 19, 2013 at 09:00:34AM -0700, Srinivas Pandruvada wrote:
>> Adding BIT(x) equivalent for unsigned long long type, BIT_ULL(x).
>>
>> Suggested-by: Joe Perches <joe@perches.com>
>> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
>> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>   include/linux/bitops.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/bitops.h b/include/linux/bitops.h
>> index a3b6b82..34e9e94 100644
>> --- a/include/linux/bitops.h
>> +++ b/include/linux/bitops.h
>> @@ -4,6 +4,7 @@
>>   
>>   #ifdef	__KERNEL__
>>   #define BIT(nr)			(1UL << (nr))
>> +#define BIT_ULL(nr)		(1ULL << (nr))
> We already have BIT_64 for that.
>
The current definition for BIT_64 is in arch/x86/include/asm/bitops.h. I 
feel it should be applicable for all architectures and move to some 
common file.

Thanks,
Srinivas
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Borislav Petkov Sept. 19, 2013, 5:28 p.m. UTC | #3
On Thu, Sep 19, 2013 at 10:07:35AM -0700, Srinivas Pandruvada wrote:
> The current definition for BIT_64 is in arch/x86/include/asm/bitops.h.
> I feel it should be applicable for all architectures and move to some
> common file.

Feel free to move it there or change BIT_64 to BIT_ULL or whatever ...
just don't add yet another redundant macro.

Thanks.
diff mbox

Patch

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index a3b6b82..34e9e94 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -4,6 +4,7 @@ 
 
 #ifdef	__KERNEL__
 #define BIT(nr)			(1UL << (nr))
+#define BIT_ULL(nr)		(1ULL << (nr))
 #define BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define BITS_PER_BYTE		8