Skip to content

Commit

Permalink
drm/prime: clarify logic a bit in drm_gem_prime_fd_to_handle
Browse files Browse the repository at this point in the history
if (!ret) implies that ret == 0, so no need to clear it again. And
explicitly check for ret == 0 to indicate that we're checking an errno
integer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Daniel Vetter authored and Dave Airlie committed Aug 21, 2013
1 parent bdf655d commit 84341c2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/drm_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,8 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,

ret = drm_prime_lookup_buf_handle(&file_priv->prime,
dma_buf, handle);
if (!ret) {
ret = 0;
if (ret == 0)
goto out_put;
}

/* never seen this one, need to import */
obj = dev->driver->gem_prime_import(dev, dma_buf);
Expand Down

0 comments on commit 84341c2

Please sign in to comment.