]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm: fix minor number range calculation
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 8 Aug 2013 17:10:21 +0000 (19:10 +0200)
committerDave Airlie <airlied@redhat.com>
Mon, 19 Aug 2013 04:22:29 +0000 (14:22 +1000)
Currently, both ranges overlap. Fix the limits so both ranges are mutually
exclusive. Also use the occasion to convert whitespaces to tabs.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
(fixed up tabs and adjust commit-msg accordingly)
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_stub.c

index aa0664d9106084aa49cf8eaf00b8ea15bf0fdc19..5edf938bbcc300f7e343153ac7ef6eb412ea7caa 100644 (file)
@@ -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);