drm: drop redundant drm_file->is_master
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 22 Jul 2014 16:46:09 +0000 (18:46 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 5 Aug 2014 14:07:50 +0000 (16:07 +0200)
commit48ba813701eb14b3008edefef4a0789b328e278c
treecab45fc97db3eb800338196add945c6f47643cee
parent9f8d21ea276177547725a60cefc1b6da742f14d3
drm: drop redundant drm_file->is_master

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: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/drm_lock.c
drivers/gpu/drm/drm_stub.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/staging/imx-drm/imx-drm-core.c
include/drm/drmP.h