public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Clean up ancient doc comments for i915_ioc32.c
Date: Wed, 14 Feb 2018 17:42:37 +0200	[thread overview]
Message-ID: <877erflgr6.fsf@intel.com> (raw)
In-Reply-To: <20180214152911.9242-1-chris@chris-wilson.co.uk>

On Wed, 14 Feb 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> As befitting a file dedicated to the mistakes of the past,
>
> drivers/gpu/drm/i915/i915_ioc32.c:2: warning: Cannot understand  * \file i915_ioc32.c
>  on line 2 - I thought it was a doc line
> drivers/gpu/drm/i915/i915_ioc32.c:82: warning: Function parameter or member 'filp' not described in 'i915_compat_ioctl'
> drivers/gpu/drm/i915/i915_ioc32.c:82: warning: Function parameter or member 'cmd' not described in 'i915_compat_ioctl'
> drivers/gpu/drm/i915/i915_ioc32.c:82: warning: Function parameter or member 'arg' not described in 'i915_compat_ioctl'
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_ioc32.c | 38 ++++++++++++++++----------------------
>  1 file changed, 16 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
> index 97f3a5640289..73599be641e7 100644
> --- a/drivers/gpu/drm/i915/i915_ioc32.c
> +++ b/drivers/gpu/drm/i915/i915_ioc32.c
> @@ -1,11 +1,6 @@
> -/**
> - * \file i915_ioc32.c
> - *
> +/*
>   * 32-bit ioctl compatibility routines for the i915 DRM.
>   *
> - * \author Alan Hourihane <alanh@fairlite.demon.co.uk>
> - *
> - *
>   * Copyright (C) Paul Mackerras 2005
>   * Copyright (C) Alan Hourihane 2005
>   * All Rights Reserved.
> @@ -28,6 +23,8 @@
>   * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>   * IN THE SOFTWARE.
> + *
> + * Author: Alan Hourihane <alanh@fairlite.demon.co.uk>
>   */
>  #include <linux/compat.h>
>  
> @@ -55,9 +52,9 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd,
>  		return -EFAULT;
>  
>  	request = compat_alloc_user_space(sizeof(*request));
> -	if (!access_ok(VERIFY_WRITE, request, sizeof(*request))
> -	    || __put_user(req32.param, &request->param)
> -	    || __put_user((void __user *)(unsigned long)req32.value,
> +	if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) ||
> +	    __put_user(req32.param, &request->param) ||
> +	    __put_user((void __user *)(unsigned long)req32.value,
>  			  &request->value))
>  		return -EFAULT;
>  
> @@ -70,30 +67,27 @@ static drm_ioctl_compat_t *i915_compat_ioctls[] = {
>  };
>  
>  /**
> + * i915_compat_ioctl - handle the mistakes of the past
> + * @filp: the file pointer
> + * @cmd: the ioctl command (and encoded flags)
> + * @arg: the ioctl argument (from userspace)
> + *
>   * Called whenever a 32-bit process running under a 64-bit kernel
>   * performs an ioctl on /dev/dri/card<n>.
> - *
> - * \param filp file pointer.
> - * \param cmd command.
> - * \param arg user argument.
> - * \return zero on success or negative number on failure.
>   */
>  long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>  {
>  	unsigned int nr = DRM_IOCTL_NR(cmd);
> -	drm_ioctl_compat_t *fn = NULL;
> -	int ret;
> +	drm_ioctl_compat_t *fn;
>  
>  	if (nr < DRM_COMMAND_BASE || nr >= DRM_COMMAND_END)
>  		return drm_compat_ioctl(filp, cmd, arg);
>  
> +	fn = NULL;
>  	if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(i915_compat_ioctls))
>  		fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE];
> +	if (fn)
> +		return fn(filp, cmd, arg);

Not really fond of code juggling in a patch that's supposed to be about
doc comment updates.

But if you do this, you might just as well move the if (fn) check within
the preceding if block, and get rid of the fn = NULL initialization
altogheter.

BR,
Jani.


>  
> -	if (fn != NULL)
> -		ret = (*fn) (filp, cmd, arg);
> -	else
> -		ret = drm_ioctl(filp, cmd, arg);
> -
> -	return ret;
> +	return drm_ioctl(filp, cmd, arg);
>  }

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-14 15:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 15:29 [PATCH] drm/i915: Clean up ancient doc comments for i915_ioc32.c Chris Wilson
2018-02-14 15:42 ` Jani Nikula [this message]
2018-02-14 15:47   ` Chris Wilson
2018-02-14 16:09     ` Jani Nikula
2018-02-14 15:45 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-02-14 16:01 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-14 16:05 ` [PATCH v2] " Chris Wilson
2018-02-14 16:07 ` [PATCH v3] " Chris Wilson
2018-02-15  7:43   ` Chris Wilson
2018-02-15 14:00     ` Jani Nikula
2018-02-15 17:05       ` Chris Wilson
2018-02-14 17:36 ` ✓ Fi.CI.BAT: success for drm/i915: Clean up ancient doc comments for i915_ioc32.c (rev3) Patchwork
2018-02-15  0:27 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877erflgr6.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox