From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/4] drm/i915: return -ENOENT if the context doesn't exist Date: Tue, 19 Jun 2012 18:27:49 +0200 Message-ID: <20120619162749.GA5031@phenom.ffwll.local> References: <1340117552-3605-1-git-send-email-daniel.vetter@ffwll.ch> <1340117552-3605-3-git-send-email-daniel.vetter@ffwll.ch> <20120619091911.3c4a7bde@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 24BB09F639 for ; Tue, 19 Jun 2012 09:26:31 -0700 (PDT) Received: by bkwj4 with SMTP id j4so5997869bkw.36 for ; Tue, 19 Jun 2012 09:26:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20120619091911.3c4a7bde@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Tue, Jun 19, 2012 at 09:19:11AM -0700, Ben Widawsky wrote: > On Tue, 19 Jun 2012 16:52:31 +0200 > Daniel Vetter wrote: > > > This is our customary "no such object" errno, not -EINVAL. > > > > Signed-Off-by: Daniel Vetter > > You've missed idr_cleanup for this. That doesn't get back down to > userspace, but it keeps things consistent. Yeah, I've noticed the -ENXIO in the cleanup code. I think we can completely rip that one out (and it won't ever reach userspace anyway), so I've decided to ingore that one. I'll stitch toghet that patch quickly. -Daniel > > With that, this is > Reviewed-by: Ben Widawsky > > --- > > drivers/gpu/drm/i915/i915_gem_context.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c > > index 671927a..3d8ae6c 100644 > > --- a/drivers/gpu/drm/i915/i915_gem_context.c > > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > > @@ -455,7 +455,7 @@ int i915_switch_context(struct intel_ring_buffer *ring, > > } else { > > to = i915_gem_context_get(file_priv, to_id); > > if (to == NULL) > > - return -EINVAL; > > + return -ENOENT; > > } > > > > if (from_obj == to->obj) > > @@ -521,7 +521,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, > > ctx = i915_gem_context_get(file_priv, args->ctx_id); > > if (!ctx) { > > mutex_unlock(&dev->struct_mutex); > > - return -EINVAL; > > + return -ENOENT; > > } > > > > do_destroy(ctx); > > > > -- > Ben Widawsky, Intel Open Source Technology Center -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48