[PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro

Mark Cave-Ayland posted 2 patches 2 weeks, 5 days ago
Maintainers: John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, "Cédric Le Goater" <clg@redhat.com>
[PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro
Posted by Mark Cave-Ayland 2 weeks, 5 days ago
This should help avoid incorrect constant values being used in future. At
the same time we can remove the gap left for BIT(1) which was originally
intended for the VFIO_PROXY_NO_MMAP feature which was removed from later
versions of the vfio-user series.

Suggested-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/vfio-user/proxy.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
index b09fd886f1..7b97460cc5 100644
--- a/hw/vfio-user/proxy.h
+++ b/hw/vfio-user/proxy.h
@@ -91,10 +91,10 @@ typedef struct VFIOUserProxy {
 } VFIOUserProxy;
 
 /* VFIOProxy flags */
-#define VFIO_PROXY_CLIENT        0x1
-#define VFIO_PROXY_FORCE_QUEUED  0x4
-#define VFIO_PROXY_NO_POST       0x8
-#define VFIO_PROXY_USE_MULTI     0x10
+#define VFIO_PROXY_CLIENT        BIT(0)
+#define VFIO_PROXY_FORCE_QUEUED  BIT(1)
+#define VFIO_PROXY_NO_POST       BIT(2)
+#define VFIO_PROXY_USE_MULTI     BIT(3)
 
 /* coalescing high and low water marks for VFIOProxy num_outgoing */
 #define VFIO_USER_OUT_HIGH       1024
-- 
2.43.0
Re: [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro
Posted by John Levon 2 weeks, 5 days ago
On Wed, Jan 21, 2026 at 10:59:46AM +0000, Mark Cave-Ayland wrote:

> This should help avoid incorrect constant values being used in future. At
> the same time we can remove the gap left for BIT(1) which was originally
> intended for the VFIO_PROXY_NO_MMAP feature which was removed from later
> versions of the vfio-user series.
> 
> Suggested-by: John Levon <john.levon@nutanix.com>
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  hw/vfio-user/proxy.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
> index b09fd886f1..7b97460cc5 100644
> --- a/hw/vfio-user/proxy.h
> +++ b/hw/vfio-user/proxy.h
> @@ -91,10 +91,10 @@ typedef struct VFIOUserProxy {
>  } VFIOUserProxy;
>  
>  /* VFIOProxy flags */
> -#define VFIO_PROXY_CLIENT        0x1
> -#define VFIO_PROXY_FORCE_QUEUED  0x4
> -#define VFIO_PROXY_NO_POST       0x8
> -#define VFIO_PROXY_USE_MULTI     0x10
> +#define VFIO_PROXY_CLIENT        BIT(0)
> +#define VFIO_PROXY_FORCE_QUEUED  BIT(1)
> +#define VFIO_PROXY_NO_POST       BIT(2)
> +#define VFIO_PROXY_USE_MULTI     BIT(3)
>  
>  /* coalescing high and low water marks for VFIOProxy num_outgoing */
>  #define VFIO_USER_OUT_HIGH       1024

Reviewed-by: John Levon <john.levon@nutanix.com>

thanks
john