From 48ba813701eb14b3008edefef4a0789b328e278c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 22 Jul 2014 18:46:09 +0200 Subject: 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 Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- drivers/staging/imx-drm/imx-drm-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging') diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index 6f54ff4f9372..72913b299047 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c @@ -182,7 +182,7 @@ static void imx_drm_driver_preclose(struct drm_device *drm, { int i; - if (!file->is_master) + if (!drm_is_master(file)) return; for (i = 0; i < MAX_CRTC; i++) -- cgit v1.2.3