Skip to contentSkip to conversation

drm: fix minor number range calculation

PATCH In review David Herrmann 1 participant 2 messages Aug 8, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: fix minor number range calculation

Currently, both ranges overlap. Fix the limits so both ranges are mutually exclusive. Also use the occasion to convert whitespaces to tabs.

(fixed up tabs and adjust commit-msg accordingly)

---
 drivers/gpu/drm/drm_stub.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_stub.c +6 -6
index d663f7d..ca24ad0 100644
@@ -113,12 +113,12 @@ static int drm_minor_get_id(struct drm_device *dev, int type)
 	int base = 0, limit = 63;
 
 	if (type == DRM_MINOR_CONTROL) {
-                base += 64;
-                limit = base + 127;
-        } else if (type == DRM_MINOR_RENDER) {
-                base += 128;
-                limit = base + 255;
-        }
+		base += 64;
+		limit = base + 63;
+	} else if (type == DRM_MINOR_RENDER) {
+		base += 128;
+		limit = base + 63;
+	}
 
 	mutex_lock(&dev->struct_mutex);
 	ret = idr_alloc(&drm_minors_idr, NULL, base, limit, GFP_KERNEL);
Signature · 6 lines
1.8.3.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi

Quoted 6 lines · David Herrmann

Currently, both ranges overlap. Fix the limits so both ranges are mutually exclusive. Also use the occasion to convert whitespaces to tabs.

(fixed up tabs and adjust commit-msg accordingly)

Umh, somehow this dropped the author line. It's supposed to be:
Author: Kristian Høgsberg <[email protected]>

Regards
David

Quoted 30 lines
---
 drivers/gpu/drm/drm_stub.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_stub.c +6 -7
index d663f7d..ca24ad0 100644
@@ -113,12 +113,12 @@ static int drm_minor_get_id(struct drm_device *dev, int type)
        int base = 0, limit = 63;
 
        if (type == DRM_MINOR_CONTROL) {
-                base += 64;
-                limit = base + 127;
-        } else if (type == DRM_MINOR_RENDER) {
-                base += 128;
-                limit = base + 255;
-        }
+               base += 64;
+               limit = base + 63;
+       } else if (type == DRM_MINOR_RENDER) {
+               base += 128;
+               limit = base + 63;
+       }
 
        mutex_lock(&dev->struct_mutex);
        ret = idr_alloc(&drm_minors_idr, NULL, base, limit, GFP_KERNEL);
--

1.8.3.4