Skip to content
  • David Herrmann's avatar
    drm: drop redundant drm_file->is_master · 48ba8137
    David Herrmann authored
    
    
    The drm_file->is_master field is redundant as it's equivalent to:
        drm_file->master && drm_file->master == drm_file->minor->master
    
    1) "=>"
      Whenever we set drm_file->is_master, we also set:
          drm_file->minor->master = drm_file->master;
    
      Whenever we clear drm_file->is_master, we also call:
          drm_master_put(&drm_file->minor->master);
      which implicitly clears it to NULL.
    
    2) "<="
      minor->master cannot be set if it is non-NULL. Therefore, it stays as
      is unless a file drops it.
    
      If minor->master is NULL, it is only set by places that also adjust
      drm_file->is_master.
    
    Therefore, we can safely drop is_master and replace it by an inline helper
    that matches:
        drm_file->master && drm_file->master == drm_file->minor->master
    
    Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
    48ba8137