[Spice-devel] [spice] dcc: Remove a redundant NULL pointer check in dcc_create_surface()

Frediano Ziglio fziglio at redhat.com
Thu Mar 21 11:33:28 UTC 2019


> 
> dcc_create_surface() already returns immediately if dcc is NULL.

Yes, and even this check is useless.

> 
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>

Acked.

> ---
>  server/dcc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/server/dcc.c b/server/dcc.c
> index a05b6e59e..b6cd6b3f9 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -303,8 +303,7 @@ void dcc_create_surface(DisplayChannelClient *dcc, int
> surface_id)
>      flags = is_primary_surface(display, surface_id) ?
>      SPICE_SURFACE_FLAGS_PRIMARY : 0;
>  
>      /* don't send redundant create surface commands to client */
> -    if (!dcc ||
> -
> common_graphics_channel_get_during_target_migrate(COMMON_GRAPHICS_CHANNEL(display))
> ||
> +    if
> (common_graphics_channel_get_during_target_migrate(COMMON_GRAPHICS_CHANNEL(display))
> ||
>          dcc->priv->surface_client_created[surface_id]) {
>          return;
>      }


More information about the Spice-devel mailing list