Skip to content

Commit 41f7162

Browse files
mh12gx2825thierryreding
authored andcommitted
drm/tegra: replace idr_init() by idr_init_base()
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 6ce711f ("idr: Make 1-based IDRs more efficient") Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 5c1d644 commit 41f7162

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/gpu/drm/tegra

drivers/gpu/drm/tegra/drm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp)
9090
if (!fpriv)
9191
return -ENOMEM;
9292

93-
idr_init(&fpriv->contexts);
93+
idr_init_base(&fpriv->contexts, 1);
9494
mutex_init(&fpriv->lock);
9595
filp->driver_priv = fpriv;
9696

0 commit comments

Comments
 (0)