From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Vesely Subject: Re: [libdrm][PATCH 3/2] Fix always true comparison. Date: Mon, 02 Mar 2015 15:01:09 -0500 Message-ID: <1425326469.9583.23.camel@rutgers.edu> References: <1423517995-28251-1-git-send-email-jan.vesely@rutgers.edu> <1423527043-21264-1-git-send-email-jan.vesely@rutgers.edu> <1424884300.4113.11.camel@rutgers.edu> <54EE1755.2040102@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0614388403==" Return-path: Received: from mail-qa0-f45.google.com (mail-qa0-f45.google.com [209.85.216.45]) by gabe.freedesktop.org (Postfix) with ESMTP id A343A6E0C2 for ; Mon, 2 Mar 2015 12:01:12 -0800 (PST) Received: by mail-qa0-f45.google.com with SMTP id j7so24707661qaq.4 for ; Mon, 02 Mar 2015 12:01:12 -0800 (PST) In-Reply-To: <54EE1755.2040102@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0614388403== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-7UAfTg20KJFOeiqqBEq0" --=-7UAfTg20KJFOeiqqBEq0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-02-25 at 18:41 +0000, Emil Velikov wrote: > On 25/02/15 17:11, Jan Vesely wrote: > > gentle ping > >=20 > 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 :-( >=20 > 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 >=20 > -Emil >=20 > >=20 > > 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 condi= tions. > >> So check for -1 explicitly. > >> > >> Signed-off-by: Jan Vesely > >> --- > >> > >> I could not find whether it's actually legal to return encoded negativ= e 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 =3D serv_mode ? serv_mode : DRM_DEV_MODE; > >> devmode &=3D ~(S_IXUSR|S_IXGRP|S_IXOTH); > >> - group =3D (serv_group >=3D 0) ? serv_group : DRM_DEV_GID; > >> + group =3D (serv_group !=3D ~0U) ? serv_group : DRM_DEV_GID; > >> } > >> =20 > >> #if !defined(UDEV) > >=20 >=20 --=20 Jan Vesely --=-7UAfTg20KJFOeiqqBEq0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJU9MGFAAoJEDhUsXb6ZiH/cxwQAJb2wCoDWhAjFq0r/6UFYOAR QkwXz3Hgh/aUCG7awaV679DirNSbrZU+QBiDM3LEZkKsw4+Ykt4xHtcVqRakOeHi VEK7KQT6paOLoEt+n+u9z/OnqqigUnNIIrRoqoLf3206g99jEjddthOifoNqwjBb kaTx4FgFVmtJquVe0Z5kR6gXZ4qURfcMwmx3zTmDclwtsfUnHirWRxbSuRXHp3gj 4A4EXxusir5EsDe9gepGBnAcIZFTosGb9clP3jFmbcYh4rKirhB1oeZ1STPLamnO bfO+OJWNQo9wB4E8EshEcw9Fx1y5wuloykyQWwDNBWm/NI6yi5hsmjmMTPQPxjCS vuLm5T1MUZZY+Y5d97uBdldNiKLEC6VQbqESj5osmBYHybE1OqU4M6PFAMqqkk+l Pxh6AAzfG97orXAqUkB9L28GmXWtjzHpRujgVghWofx9n1+HV11t1OEVgGOWB5r5 CdReGHpzPhKgftKsyn7miOGTSesA+kG7CFDTzzfgZ03PdwvlhpQkgK7o/Iv/EOs0 1cUhHL5lQy+92M+B2DhBJvsOJ+6W/2EciWKgGJHTzPc4qBuKHEgywz0Tmt9tk6rp 3jjkDg+mFR0csDGDCpBylYLptIfVCHNIJ2r8lkjcaEOH8Ew1g+iOpa3qoxA/yBzy 5/dunALHGUscH4i58oFp =93XY -----END PGP SIGNATURE----- --=-7UAfTg20KJFOeiqqBEq0-- --===============0614388403== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============0614388403==--