[PATCH v2] ivi-controller: do refactor send_layer_add_event

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Jun 17 09:52:08 EDT 2016


Hi Natsume-san,

Both patches look good.

Best regards

Emre Ucan
Software Group I (ADITG/SW1)

Tel. +49 5121 49 6937

> -----Original Message-----
> From: genivi-ivi-layer-management-bounces at lists.genivi.org [mailto:genivi-
> ivi-layer-management-bounces at lists.genivi.org] On Behalf Of Natsume,
> Wataru (ADITJ/SWG)
> Sent: Donnerstag, 16. Juni 2016 14:23
> To: genivi-ivi-layer-management at lists.genivi.org
> Cc: securitycheck at denso.co.jp
> Subject: [PATCH v2] ivi-controller: do refactor send_layer_add_event
> 
> 
> Check logic should be improved because iviscrn is never null.
> Besides, do not iterate over empty list like send_surface_add_event.
> 
> Signed-off-by: Wataru Natsume <wataru_natsume at xddp.denso.co.jp>
> ---
> Changes from v1 - Logic optimized through review
> 
>  weston-ivi-shell/src/ivi-controller-impl.c |   23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-
> controller-impl.c
> index a8242f6..490f4c1 100644
> --- a/weston-ivi-shell/src/ivi-controller-impl.c
> +++ b/weston-ivi-shell/src/ivi-controller-impl.c
> @@ -292,23 +292,22 @@ send_layer_add_event(struct ivilayer *ivilayer,
>      else if (mask & IVI_NOTIFICATION_ADD) {
>          for (i = 0; i < (int)length; i++) {
>              /* Send new layer event */
> -            iviscrn = NULL;
> +            if (wl_list_empty(&shell->list_screen)){
> +                break;
> +            }
> +
>              wl_list_for_each(iviscrn, &shell->list_screen, link) {
>                  if (iviscrn->layout_screen == pArray[i]) {
> +                    resource_output =
> +                        wl_resource_find_for_client(&iviscrn->output->resource_list,
> +                                                    client);
> +                    if (resource_output != NULL) {
> +                        ivi_controller_layer_send_screen(resource, resource_output);
> +                    }
> +
>                      break;
>                  }
>              }
> -
> -            if (iviscrn == NULL) {
> -                continue;
> -            }
> -
> -            resource_output =
> -                wl_resource_find_for_client(&iviscrn->output->resource_list,
> -                                     client);
> -            if (resource_output != NULL) {
> -                ivi_controller_layer_send_screen(resource, resource_output);
> -            }
>          }
>      }
> 
> --
> 1.7.9.5




More information about the genivi-ivi-layer-management mailing list