From patchwork Thu Aug 8 17:10:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2841321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2B829F295 for ; Thu, 8 Aug 2013 17:11:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 833C2202C6 for ; Thu, 8 Aug 2013 17:11:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C56E6202AE for ; Thu, 8 Aug 2013 17:11:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CCA11E64AB for ; Thu, 8 Aug 2013 10:11:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by gabe.freedesktop.org (Postfix) with ESMTP id C2602E5C86 for ; Thu, 8 Aug 2013 10:10:56 -0700 (PDT) Received: by mail-ea0-f171.google.com with SMTP id n15so1565558ead.2 for ; Thu, 08 Aug 2013 10:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=TcT1iqmRhh6INKBNmG7MffS2RRILO/IFaS7y+S2BZNk=; b=WfFRTwaEvzxqDqEzANB+1IkUdVsq38eUM/C7akw70LuIdN0nKOFib1rg7oCz8sd4gI 27gLW90nPMRP3De8uOrAehFCpwfOS5jRjqOuw0oUB9omF2+50MW8/y6jp0oPLkgg79hK 5qYv4dHKk1Pvp39Pi4PHz3KY6ebmPsrwLBagYlvN4SkqpnTkgPdQ8FXMgs7K9DoQQe5X bvHyv3Ttl1UMrK9yXg7WfGX4P4PpVPSqm2U9lzpMcLiPAs1FAzgd9Vnth9Bsfhb+ZWxD HNwsfiUaB2dMxK2eeaxPhGQia1pmf5AF4EbNdqaB3G+oE5f2EZonzctUyq36E+F1wN0+ dhfA== X-Received: by 10.14.204.71 with SMTP id g47mr9162227eeo.145.1375981855436; Thu, 08 Aug 2013 10:10:55 -0700 (PDT) Received: from localhost.localdomain (mx-b.hotelavanti.cz. [81.19.13.62]) by mx.google.com with ESMTPSA id a4sm20810064eez.0.2013.08.08.10.10.53 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 10:10:54 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: fix minor number range calculation Date: Thu, 8 Aug 2013 19:10:21 +0200 Message-Id: <1375981821-1671-1-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Cc: Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 (fixed up tabs and adjust commit-msg accordingly) Signed-off-by: David Herrmann --- 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);