Displaying 6 results from an estimated 6 matches for "set_feature_bit".
2014 Nov 27
0
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...at redhat.com>
> ---
Wouldn't it be easier to turn
test_bit(i, dev->features)
into a simple makro like
#define test_bit(i, features) (features & (1 << i))
Similar one for clear_bit and set_bit.
if names collide with existing functions, we could simply rename them to:
set_feature_bit() ...
clear_feature_bit() ...
> diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
> index e647947..0acd564 100644
> --- a/drivers/misc/mic/card/mic_virtio.c
> +++ b/drivers/misc/mic/card/mic_virtio.c
> @@ -101,7 +101,7 @@ static void mic_finalize_f...
2014 Nov 27
0
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...at redhat.com>
> ---
Wouldn't it be easier to turn
test_bit(i, dev->features)
into a simple makro like
#define test_bit(i, features) (features & (1 << i))
Similar one for clear_bit and set_bit.
if names collide with existing functions, we could simply rename them to:
set_feature_bit() ...
clear_feature_bit() ...
> diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
> index e647947..0acd564 100644
> --- a/drivers/misc/mic/card/mic_virtio.c
> +++ b/drivers/misc/mic/card/mic_virtio.c
> @@ -101,7 +101,7 @@ static void mic_finalize_f...
2014 Nov 27
1
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...39;t really see why it's easier.
These wrappers resulted in a ton of code
converting from bit numbers to set_bit calls
and back.
E.g. with plan integer you can do (a|b|c)
to get a set with 3 bits.
>
> if names collide with existing functions, we could simply rename them to:
>
> set_feature_bit() ...
> clear_feature_bit() ...
In fact that's why we have BIT macro.
vdev->features & BIT_ULL(x) is only longer by 1
character than test_feature_bit(vdev, x), and
it's much clearer than a non standard wrapper.
vdev->features & (1ULL << x) is longer by 3 chars.
I...
2014 Nov 27
1
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...39;t really see why it's easier.
These wrappers resulted in a ton of code
converting from bit numbers to set_bit calls
and back.
E.g. with plan integer you can do (a|b|c)
to get a set with 3 bits.
>
> if names collide with existing functions, we could simply rename them to:
>
> set_feature_bit() ...
> clear_feature_bit() ...
In fact that's why we have BIT macro.
vdev->features & BIT_ULL(x) is only longer by 1
character than test_feature_bit(vdev, x), and
it's much clearer than a non standard wrapper.
vdev->features & (1ULL << x) is longer by 3 chars.
I...
2014 Nov 27
2
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
From: Rusty Russell <rusty at rustcorp.com.au>
It seemed like a good idea, but it's actually a pain when we get more
than 32 feature bits. Just change it to a u32 for now.
Cc: Brian Swetland <swetland at google.com>
Cc: Christian Borntraeger <borntraeger at de.ibm.com>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
Signed-off-by: Cornelia Huck
2014 Nov 27
2
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
From: Rusty Russell <rusty at rustcorp.com.au>
It seemed like a good idea, but it's actually a pain when we get more
than 32 feature bits. Just change it to a u32 for now.
Cc: Brian Swetland <swetland at google.com>
Cc: Christian Borntraeger <borntraeger at de.ibm.com>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
Signed-off-by: Cornelia Huck