[PATCH v2 01/21] qom/object: use BIT macro for ObjectPropertyFlags

Zhao Liu posted 21 patches 14 hours ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Zhao Liu <zhao1.liu@intel.com>
[PATCH v2 01/21] qom/object: use BIT macro for ObjectPropertyFlags
Posted by Zhao Liu 14 hours ago
Standardize the definition of ObjectPropertyFlags by using the BIT()
macro instead of manual bit shifts to improve readability.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 include/qom/object.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 26df6137b911..6226b88c1eda 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -16,6 +16,7 @@
 
 #include "qapi/qapi-builtin-types.h"
 #include "qemu/module.h"
+#include "qemu/bitops.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;
@@ -1841,9 +1842,9 @@ ObjectProperty *object_class_property_add_tm(ObjectClass *klass,
 
 typedef enum {
     /* Automatically add a getter to the property */
-    OBJ_PROP_FLAG_READ = 1 << 0,
+    OBJ_PROP_FLAG_READ = BIT(0),
     /* Automatically add a setter to the property */
-    OBJ_PROP_FLAG_WRITE = 1 << 1,
+    OBJ_PROP_FLAG_WRITE = BIT(1),
     /* Automatically add a getter and a setter to the property */
     OBJ_PROP_FLAG_READWRITE = (OBJ_PROP_FLAG_READ | OBJ_PROP_FLAG_WRITE),
 } ObjectPropertyFlags;
-- 
2.34.1