[PATCH 14/52] migration/rdma: Use bool for two RDMAContext flags

Markus Armbruster posted 52 patches 1 year, 1 month ago
Maintainers: Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Leonardo Bras <leobras@redhat.com>
There is a newer version of this series
[PATCH 14/52] migration/rdma: Use bool for two RDMAContext flags
Posted by Markus Armbruster 1 year, 1 month ago
@error_reported and @received_error are flags.  The latter is even
assigned bool true.  Change them from int to bool.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 migration/rdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 97715dbd78..c02a1c83b2 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -91,7 +91,7 @@ static uint32_t known_capabilities = RDMA_CAPABILITY_PIN_ALL;
             if (!rdma->error_reported) { \
                 error_report("RDMA is in an error state waiting migration" \
                                 " to abort!"); \
-                rdma->error_reported = 1; \
+                rdma->error_reported = true; \
             } \
             return rdma->error_state; \
         } \
@@ -365,8 +365,8 @@ typedef struct RDMAContext {
      * and remember the error state.
      */
     int error_state;
-    int error_reported;
-    int received_error;
+    bool error_reported;
+    bool received_error;
 
     /*
      * Description of ram blocks used throughout the code.
-- 
2.41.0
Re: [PATCH 14/52] migration/rdma: Use bool for two RDMAContext flags
Posted by Zhijian Li (Fujitsu) 1 year ago

On 18/09/2023 22:41, Markus Armbruster wrote:
> @error_reported and @received_error are flags.  The latter is even
> assigned bool true.  Change them from int to bool.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>

> ---
>   migration/rdma.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 97715dbd78..c02a1c83b2 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -91,7 +91,7 @@ static uint32_t known_capabilities = RDMA_CAPABILITY_PIN_ALL;
>               if (!rdma->error_reported) { \
>                   error_report("RDMA is in an error state waiting migration" \
>                                   " to abort!"); \
> -                rdma->error_reported = 1; \
> +                rdma->error_reported = true; \
>               } \
>               return rdma->error_state; \
>           } \
> @@ -365,8 +365,8 @@ typedef struct RDMAContext {
>        * and remember the error state.
>        */
>       int error_state;
> -    int error_reported;
> -    int received_error;
> +    bool error_reported;
> +    bool received_error;
>   
>       /*
>        * Description of ram blocks used throughout the code.
Re: [PATCH 14/52] migration/rdma: Use bool for two RDMAContext flags
Posted by Fabiano Rosas 1 year, 1 month ago
Markus Armbruster <armbru@redhat.com> writes:

> @error_reported and @received_error are flags.  The latter is even
> assigned bool true.  Change them from int to bool.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Fabiano Rosas <farosas@suse.de>