Peter Xu <[email protected]> writes:

> Introduce this to say how many control messages we have.  We did it because
> we're going to remove the last one (RDMA_CONTROL_UNREGISTER_FINISHED) soon.
>
> Reviewed-by: Jinpu Wang <[email protected]>
> Signed-off-by: Peter Xu <[email protected]>
> ---
>  migration/rdma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 438419d189..62a509b236 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -144,6 +144,7 @@ enum {
>      RDMA_CONTROL_REGISTER_FINISHED,   /* current iteration finished */
>      RDMA_CONTROL_UNREGISTER_REQUEST,  /* dynamic UN-registration */
>      RDMA_CONTROL_UNREGISTER_FINISHED, /* unpinning finished */
> +    RDMA_CONTROL_NUM,
>  };
>  
>  
> @@ -235,7 +236,7 @@ static const char *control_desc(unsigned int rdma_control)
>          [RDMA_CONTROL_UNREGISTER_FINISHED] = "UNREGISTER FINISHED",
>      };
>  
> -    if (rdma_control > RDMA_CONTROL_UNREGISTER_FINISHED) {
> +    if (rdma_control >= RDMA_CONTROL_NUM) {
>          return "??BAD CONTROL VALUE??";
>      }

Reviewed-by: Fabiano Rosas <[email protected]>

Reply via email to