From: David Herrmann Date: Wed, 29 Jan 2014 11:31:40 +0000 (+0100) Subject: drm: turn DRM_MINOR_* into enum X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb8a239b03608079cbfb784e9ac2f522fe846c29;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: turn DRM_MINOR_* into enum Use enum for DRM_MINOR_* constants to avoid hard-coding the IDs. Furthermore, add a DRM_MINOR_CNT so we can perform range-checks in follow-ups. This changes the IDs of the minor-types by -1, but they're not used as indices so this is fine. Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter --- diff --git a/include/drm/drmP.h b/include/drm/drmP.h index ff20b888d525..2c322564ca7d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1008,9 +1008,12 @@ struct drm_driver { struct list_head legacy_dev_list; }; -#define DRM_MINOR_LEGACY 1 -#define DRM_MINOR_CONTROL 2 -#define DRM_MINOR_RENDER 3 +enum drm_minor_type { + DRM_MINOR_LEGACY, + DRM_MINOR_CONTROL, + DRM_MINOR_RENDER, + DRM_MINOR_CNT, +}; /** * Info file list entry. This structure represents a debugfs or proc file to