dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jan Vesely <jan.vesely@rutgers.edu>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [libdrm][PATCH 3/2] Fix always true comparison.
Date: Mon, 02 Mar 2015 15:01:09 -0500	[thread overview]
Message-ID: <1425326469.9583.23.camel@rutgers.edu> (raw)
In-Reply-To: <54EE1755.2040102@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1783 bytes --]

On Wed, 2015-02-25 at 18:41 +0000, Emil Velikov wrote:
> On 25/02/15 17:11, Jan Vesely wrote:
> > gentle ping
> > 
> Afaics it's very had to get in this code nowadays - drm_server_info is
> set only via the legacy (?) function drmSetServerInfo. With the latter
> only(?) used by the xserver when working with dri1 modules. So testing
> this is likely to be very painful :-(
> 
> This code hasn't changed since before 2007, so I doubt there are many
> people that know the details about it, so we might as well leave it for
> now ?

fair enough. the warning fixes push it to non-libudev side, so it's not
going to bug me on every build.

jan

> 
> -Emil
> 
> > 
> > On Mon, 2015-02-09 at 19:10 -0500, Jan Vesely wrote:
> >> The only user I found is xserver, it can return -1 under certain conditions.
> >> So check for -1 explicitly.
> >>
> >> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
> >> ---
> >>
> >> I could not find whether it's actually legal to return encoded negative values
> >> in get_perm. This is a quick fix to detect the one case that I found.
> >>
> >>  xf86drm.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/xf86drm.c b/xf86drm.c
> >> index fb673b5..8e54ac9 100644
> >> --- a/xf86drm.c
> >> +++ b/xf86drm.c
> >> @@ -335,7 +335,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
> >>  	drm_server_info->get_perms(&serv_group, &serv_mode);
> >>  	devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
> >>  	devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
> >> -	group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
> >> +	group = (serv_group != ~0U) ? serv_group : DRM_DEV_GID;
> >>      }
> >>  
> >>  #if !defined(UDEV)
> > 
> 

-- 
Jan Vesely <jan.vesely@rutgers.edu>

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2015-03-02 20:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 21:39 [libdrm][PATCH 1/2] random: Use unsigned long for seed Jan Vesely
2015-02-09 21:39 ` [libdrm][PATCH 2/2] Fix gcc -Wextra warnings Jan Vesely
2015-02-09 23:12   ` Ian Romanick
2015-02-09 23:32   ` Emil Velikov
2015-02-10  0:02     ` Jan Vesely
2015-02-10  0:27       ` Emil Velikov
2015-02-10 21:37         ` Jan Vesely
2015-02-10 22:55           ` Emil Velikov
2015-02-09 23:11 ` [libdrm][PATCH 1/2] random: Use unsigned long for seed Ian Romanick
2015-02-09 23:26   ` Jan Vesely
2015-02-09 23:28   ` [libdrm][PATCH v2 " Jan Vesely
2015-02-10 18:21     ` Ian Romanick
2015-02-10  0:10 ` [libdrm][PATCH 3/2] Fix always true comparison Jan Vesely
2015-02-25 17:11   ` Jan Vesely
2015-02-25 18:41     ` Emil Velikov
2015-03-02 20:01       ` Jan Vesely [this message]

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=1425326469.9583.23.camel@rutgers.edu \
    --to=jan.vesely@rutgers.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).