Skip to content

Commit

Permalink
drm: turn DRM_MINOR_* into enum
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Herrmann committed Mar 16, 2014
1 parent b9a0d15 commit cb8a239
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb8a239

Please sign in to comment.