diff mbox

drm: fix minor number range calculation

Message ID 1375981821-1671-1-git-send-email-dh.herrmann@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

David Herrmann Aug. 8, 2013, 5:10 p.m. UTC
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>
---
 drivers/gpu/drm/drm_stub.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

David Herrmann Aug. 8, 2013, 5:12 p.m. UTC | #1
Hi

On Thu, Aug 8, 2013 at 7:10 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
> 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>

Umh, somehow this dropped the author line. It's supposed to be:
  Author: Kristian Høgsberg <krh@bitplanet.net>

Regards
David

> ---
>  drivers/gpu/drm/drm_stub.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
> index d663f7d..ca24ad0 100644
> --- a/drivers/gpu/drm/drm_stub.c
> +++ b/drivers/gpu/drm/drm_stub.c
> @@ -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
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index d663f7d..ca24ad0 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -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);