From: Sam Ravnborg <sam@ravnborg.org>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/auth: drop unnessesary variable assignments
Date: Sat, 30 May 2020 09:48:30 +0200 [thread overview]
Message-ID: <20200530074830.GB70485@ravnborg.org> (raw)
In-Reply-To: <20200529214807.3801851-2-emil.l.velikov@gmail.com>
Hi Emil.
On Fri, May 29, 2020 at 10:48:07PM +0100, Emil Velikov wrote:
> The variables are already the exact same value or will be overwritten
> shortly afterwords. In either case there's no functional difference.
s/afterwords/afterwards/
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
> drivers/gpu/drm/drm_auth.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
> index db701a9e9393..5ae5623f2482 100644
> --- a/drivers/gpu/drm/drm_auth.c
> +++ b/drivers/gpu/drm/drm_auth.c
> @@ -215,7 +215,7 @@ drm_master_check_perm(struct drm_device *dev, struct drm_file *file_priv)
> int drm_setmaster_ioctl(struct drm_device *dev, void *data,
> struct drm_file *file_priv)
> {
> - int ret = 0;
> + int ret;
This was the redundant asignment I mentioned in first mail - good.
>
> mutex_lock(&dev->master_mutex);
>
> @@ -282,7 +282,6 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
>
> if (file_priv->master->lessor != NULL) {
> DRM_DEBUG_LEASE("Attempt to drop lessee %d as master\n", file_priv->master->lessee_id);
> - ret = -EINVAL;
This is wrong. ret is 0 when this code is reached, so we loose the error
value if this code-path is triggered.
Or I miss something??
Sam
> goto out_unlock;
> }
>
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-05-30 7:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 21:48 [PATCH 1/2] drm: vmwgfx: remove drm_driver::master_set() return typ Emil Velikov
2020-05-29 21:48 ` [PATCH 2/2] drm/auth: drop unnessesary variable assignments Emil Velikov
2020-05-30 7:48 ` Sam Ravnborg [this message]
2020-05-30 12:13 ` Emil Velikov
2020-05-30 7:44 ` [PATCH 1/2] drm: vmwgfx: remove drm_driver::master_set() return typ Sam Ravnborg
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=20200530074830.GB70485@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.