Re: [PATCH 1/3] drm: Fix DRM_MINOR limits for control and render nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Fri, 28 Sep 2012, Kristian Høgsberg wrote:


 	if (type == DRM_MINOR_CONTROL) {
                 base += 64;
-                limit = base + 127;
+                limit = base + 64;
         } else if (type == DRM_MINOR_RENDER) {
                 base += 128;
-                limit = base + 255;
+                limit = base + 64;

If my first grade arithmetics serves me well, shouldn't limit in the first clause be base + 63 and in the second clause, base + 127. The render node starts at 128 and spans to 255, so there are total of 128 render nodes, 64 card (legacy) nodes and 64 control nodes allowed.

Actually, this construction of limit relative to the base does not achieve anything. The code would be much more readable if it were something like this:

	if (type == DRM_MINOR_CONTROL) {
                base = 64;
                limit = 127;
        } else if (type == DRM_MINOR_RENDER) {
                base = 128;
                limit = 255;
        }

-- Ilija
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux