]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drm: turn DRM_MINOR_* into enum
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 29 Jan 2014 11:31:40 +0000 (12:31 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 16 Mar 2014 11:25:17 +0000 (12:25 +0100)
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 <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
include/drm/drmP.h

index ff20b888d525578069f05cfcf88f9ce9f96c206e..2c322564ca7da6e4d3b7989dff3f2432a8dd99fd 100644 (file)
@@ -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