Displaying 20 results from an estimated 72 matches for "__virtio_set_bit".
2014 Nov 27
4
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...virtio_test_bit(const struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+ BUILD_BUG_ON(fbit >= 32);
+ else
+ BUG_ON(fbit >= 32);
+
+ return test_bit(fbit, vdev->features);
+}
+
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+...
2014 Nov 27
4
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...virtio_test_bit(const struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+ BUILD_BUG_ON(fbit >= 32);
+ else
+ BUG_ON(fbit >= 32);
+
+ return test_bit(fbit, vdev->features);
+}
+
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+...
2014 Dec 14
7
[PATCH 0/6] virtio 1.0: tools update
virtio test support for virtio 1.0.
Probably a good idea to include for 3.19.
Michael S. Tsirkin (6):
tools/virtio: more stubs
tools/virtio: fix vringh test
tools/virtio: 64 bit features
tools/virtio: enable -Werror
tools/virtio: add virtio 1.0 in virtio_test
tools/virtio: add virtio 1.0 in vringh_test
tools/virtio/linux/virtio.h | 1 +
2014 Dec 14
7
[PATCH 0/6] virtio 1.0: tools update
virtio test support for virtio 1.0.
Probably a good idea to include for 3.19.
Michael S. Tsirkin (6):
tools/virtio: more stubs
tools/virtio: fix vringh test
tools/virtio: 64 bit features
tools/virtio: enable -Werror
tools/virtio: add virtio 1.0 in virtio_test
tools/virtio: add virtio 1.0 in vringh_test
tools/virtio/linux/virtio.h | 1 +
2014 Nov 30
0
[PATCH v7 02/46] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Dec 01
0
[PATCH v8 02/50] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Nov 30
0
[PATCH v7 02/46] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Dec 01
0
[PATCH v8 02/50] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Dec 14
0
[PATCH 1/6] tools/virtio: more stubs
...irtio_test_bit - helper to test feature bits. For use by transports.
* Devices should normally use virtio_has_feature,
@@ -16,6 +15,28 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
return vdev->features & (1ULL << fbit);
}
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ vdev->features |= (1ULL << fbit);
+}
+
+/**
+ * __virtio_clear_bit - helper to clear...
2014 Dec 14
0
[PATCH 1/6] tools/virtio: more stubs
...irtio_test_bit - helper to test feature bits. For use by transports.
* Devices should normally use virtio_has_feature,
@@ -16,6 +15,28 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
return vdev->features & (1ULL << fbit);
}
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ vdev->features |= (1ULL << fbit);
+}
+
+/**
+ * __virtio_clear_bit - helper to clear...
2014 Nov 27
2
[PATCH v6 02/46] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Nov 27
2
[PATCH v6 02/46] virtio: use u32, not bitmap for features
....h
+++ b/include/linux/virtio_config.h
@@ -92,7 +92,7 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- return test_bit(fbit, vdev->features);
+ return vdev->features & BIT(fbit);
}
/**
@@ -109,7 +109,7 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- set_bit(fbit, vdev->features);
+ vdev->features |= BIT(fbit);
}
/**
@@ -126,7 +126,7 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
else
BUG_ON(fbit >= 32);
- clear_bit(fbit, vdev->features...
2014 Nov 28
0
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ON(fbit >= 32);
> + else
> + BUG_ON(fbit >= 32);
Does this want to be a helper? Might be overkill, but I'm always wary
of changes that need to be applied manually in many different places :)
> +
> + return test_bit(fbit, vdev->features);
> +}
> +
> +/**
> + * __virtio_set_bit - helper to set feature bits. For use by transports.
> + * @vdev: the device
> + * @fbit: the feature bit
> + */
> +static inline void __virtio_set_bit(struct virtio_device *vdev,
> + unsigned int fbit)
> +{
> + /* Did you forget to fix assumptions on max features? */
&g...
2014 Nov 28
0
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ON(fbit >= 32);
> + else
> + BUG_ON(fbit >= 32);
Does this want to be a helper? Might be overkill, but I'm always wary
of changes that need to be applied manually in many different places :)
> +
> + return test_bit(fbit, vdev->features);
> +}
> +
> +/**
> + * __virtio_set_bit - helper to set feature bits. For use by transports.
> + * @vdev: the device
> + * @fbit: the feature bit
> + */
> +static inline void __virtio_set_bit(struct virtio_device *vdev,
> + unsigned int fbit)
> +{
> + /* Did you forget to fix assumptions on max features? */
&g...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
...virtio_test_bit(const struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+ BUILD_BUG_ON(fbit >= 32);
+ else
+ BUG_ON(fbit >= 32);
+
+ return test_bit(fbit, vdev->features);
+}
+
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
...virtio_test_bit(const struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+ BUILD_BUG_ON(fbit >= 32);
+ else
+ BUG_ON(fbit >= 32);
+
+ return test_bit(fbit, vdev->features);
+}
+
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ /* Did you forget to fix assumptions on max features? */
+ if (__builtin_constant_p(fbit))
+...
2014 Nov 30
0
[PATCH v7 04/46] virtio: add support for 64 bit features.
...if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- return vdev->features & BIT(fbit);
+ return vdev->features & BIT_ULL(fbit);
}
/**
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features |= BIT(fbit);
+ vdev->featu...
2014 Dec 01
0
[PATCH v8 04/50] virtio: add support for 64 bit features.
...if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- return vdev->features & BIT(fbit);
+ return vdev->features & BIT_ULL(fbit);
}
/**
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features |= BIT(fbit);
+ vdev->featu...
2014 Nov 30
0
[PATCH v7 04/46] virtio: add support for 64 bit features.
...if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- return vdev->features & BIT(fbit);
+ return vdev->features & BIT_ULL(fbit);
}
/**
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features |= BIT(fbit);
+ vdev->featu...
2014 Dec 01
0
[PATCH v8 04/50] virtio: add support for 64 bit features.
...if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- return vdev->features & BIT(fbit);
+ return vdev->features & BIT_ULL(fbit);
}
/**
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev,
{
/* Did you forget to fix assumptions on max features? */
if (__builtin_constant_p(fbit))
- BUILD_BUG_ON(fbit >= 32);
+ BUILD_BUG_ON(fbit >= 64);
else
- BUG_ON(fbit >= 32);
+ BUG_ON(fbit >= 64);
- vdev->features |= BIT(fbit);
+ vdev->featu...