From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933564AbbIVQMz (ORCPT ); Tue, 22 Sep 2015 12:12:55 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:37951 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933288AbbIVQMw (ORCPT ); Tue, 22 Sep 2015 12:12:52 -0400 Date: Tue, 22 Sep 2015 18:15:44 +0200 From: Daniel Vetter To: Gerd Hoffmann Cc: Daniel Vetter , dri-devel , open list , "open list:VIRTIO GPU DRIVER" , Dave Airlie Subject: Re: [PATCH v2 5/6] virtio-gpu: add basic prime support Message-ID: <20150922161544.GY3383@phenom.ffwll.local> Mail-Followup-To: Gerd Hoffmann , dri-devel , open list , "open list:VIRTIO GPU DRIVER" , Dave Airlie References: <1442828417-6165-1-git-send-email-kraxel@redhat.com> <1442828417-6165-6-git-send-email-kraxel@redhat.com> <20150922094027.GF3383@phenom.ffwll.local> <1442935469.13084.36.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442935469.13084.36.camel@redhat.com> X-Operating-System: Linux phenom 4.1.0-2-amd64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2015 at 05:24:29PM +0200, Gerd Hoffmann wrote: > > > +int virtgpu_gem_prime_mmap(struct drm_gem_object *obj, > > > + struct vm_area_struct *area) > > > +{ > > > + WARN_ONCE(1, "not implemented"); > > > + return ENOSYS; > > > > This can get called by userspace, so please don't WARN here. Also missing > > negate sign: > > > > return -ENOSYS; > > Hmm now checkpatch throws a warning at me: > > > WARNING: ENOSYS means 'invalid syscall nr' and nothing else > #12: FILE: drivers/gpu/drm/virtio/virtgpu_prime.c:70: > + return -ENOSYS; > > > I guess I should use something else then (here and elsewhere in the > file)? Maybe -EINVAL? Other suggestions? -ENODEV is what we occasionally pick. drm is fairly creative at errno abuse, e.g. we already use -ENOENT to signal any kind of lookup failure in ioctls (even if the fd itself is obviously there so not possible that the fd isn't there). Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch