Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1930354pxu; Sun, 13 Dec 2020 07:57:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGeVdl1XOCn1djwtWPqf4MDOVbl5LYDkPF93QfL+cmGIWs9qkLV6qf5NpJW6GWVbHPVDDt X-Received: by 2002:a17:906:2f87:: with SMTP id w7mr5405659eji.83.1607875054550; Sun, 13 Dec 2020 07:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607875054; cv=none; d=google.com; s=arc-20160816; b=xHcauJD/TTwQbh0RAwls1d5q2xf+nnTHqki3OG3LegzHL+XPp3nTsfGuldpAahRLtJ d6Bd31V1Bo6HBAZpK6k6yEM2JOhHoRYyp5sS5XJQ4vvapeXh1n01tAZcQSrDxIOXMH2w 7g6O8Wy/5jVjDnUukVf3h+6+pJimvsj1pO81DBTRr8ef1xBAY2y9TOZ8C3OcrrEu9hed 7cTsm4e+nMf2lTqMU6uLkU1sUmGssdss+FF4NkfcHyhde2utRcakhCpw7Jt/rueY2+ri IZAHeNQVE6pj25BAuBaMQ55UrqcNBPlWtbjEsCWE9GCubVByTBe7g2mH7fG3x5T1Gcqm nB6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NEkRPmRLUHKA4f/4q4irZaxuELITi/Fz25emH3Y79ak=; b=GZzoKdzr95DKE0DsSbYYkTQ6WmstEVpf21hk9xnPW012F3Lie71ncwVyaGqbtVMpGg R/wSbTt+r6z+j334YFpIfm75Hvnqv6ucyCPoYue2KJSb53A91Lt69wnq/GdAFXD44ESV +h3bZBC0g4RS1mF9gDj4w8YSgNSA5fihDdb1l31fIAKmQJtFWpM1B4KNC4+16JBb87L2 36rlExfrYqcLxg8pmJ0yfyPf8H6jT56DiEzszjDsGB+am18DmLphG/JQEFZ+XzR5/vog 0pfeGSfB5OPjNxa85UmUupmWaNsyM2wDJxHvBtXwSlBAVZCyRfsKAEH1Bf1DnIcKQyAX BCSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq15si4831646edb.15.2020.12.13.07.57.12; Sun, 13 Dec 2020 07:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439390AbgLLQJq (ORCPT + 99 others); Sat, 12 Dec 2020 11:09:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:56988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439311AbgLLQIu (ORCPT ); Sat, 12 Dec 2020 11:08:50 -0500 From: Sasha Levin Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Deepak R Varma , Thierry Reding , Sasha Levin , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 03/23] drm/tegra: replace idr_init() by idr_init_base() Date: Sat, 12 Dec 2020 11:07:44 -0500 Message-Id: <20201212160804.2334982-3-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201212160804.2334982-1-sashal@kernel.org> References: <20201212160804.2334982-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Deepak R Varma [ Upstream commit 41f71629b4c432f8dd47d70ace813be5f79d4d75 ] idr_init() uses base 0 which is an invalid identifier for this driver. The new function idr_init_base allows IDR to set the ID lookup from base 1. This avoids all lookups that otherwise starts from 0 since 0 is always unused. References: commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient") Signed-off-by: Deepak R Varma Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index ba9d1c3e7cacf..e4baf07992a4d 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -90,7 +90,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) if (!fpriv) return -ENOMEM; - idr_init(&fpriv->contexts); + idr_init_base(&fpriv->contexts, 1); mutex_init(&fpriv->lock); filp->driver_priv = fpriv; -- 2.27.0