From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Vesely Subject: Re: [PATCH libdrm 4/8] xf86drmSL: Fix neighbour printing Date: Fri, 20 Mar 2015 14:01:00 -0400 Message-ID: <1426874460.3949.30.camel@rutgers.edu> References: <1425060448-5315-1-git-send-email-jan.vesely@rutgers.edu> <1425060448-5315-5-git-send-email-jan.vesely@rutgers.edu> <550C5B1A.3060706@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1779992937==" Return-path: Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 19D616E334 for ; Fri, 20 Mar 2015 11:01:05 -0700 (PDT) Received: by qcbkw5 with SMTP id kw5so99987734qcb.2 for ; Fri, 20 Mar 2015 11:01:05 -0700 (PDT) In-Reply-To: <550C5B1A.3060706@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 --===============1779992937== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Yz/ToXb3xc+gVjJtmLsU" --=-Yz/ToXb3xc+gVjJtmLsU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-03-20 at 17:38 +0000, Emil Velikov wrote: > On 27/02/15 18:07, Jan Vesely wrote: > > Signed-off-by: Jan Vesely > > --- > > xf86drmSL.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > >=20 > > diff --git a/xf86drmSL.c b/xf86drmSL.c > > index acddb54..2160bb8 100644 > > --- a/xf86drmSL.c > > +++ b/xf86drmSL.c > > @@ -266,11 +266,14 @@ int drmSLLookupNeighbors(void *l, unsigned long k= ey, > > SkipListPtr list =3D (SkipListPtr)l; > > SLEntryPtr update[SL_MAX_LEVEL + 1]; > > int retcode =3D 0; > > + SLEntryPtr entry; > > + > > + entry =3D SLLocate(list, key, update); > > =20 > > *prev_key =3D *next_key =3D key; > > *prev_value =3D *next_value =3D NULL; > > -=09 > > - if (update[0]) { > > + > > + if (entry && update[0]) { > From a very brief look at git log, the entry check should not be needed. > Must admit that I've not looked at all in the implementation of either > SLLocate or drmSLLookupNeighbors. SLLocate might return early and leave the array uninitialized. All other calls to it check the return value. I guess the warning that the previous commit tried to fix was "set-but-unused" variable. >=20 > That said it seems that none of the three files > (xf86drm{SL,Hash,Random}) has been build as a program for a while. Maybe > we could split it out as a standalone test and let it churn at make > check time ? Sounds like a good idea. I'll try to take a look when time permits, but I'd leave that as a separate patch. thanks, jan >=20 > Cheers, > Emil --=20 Jan Vesely --=-Yz/ToXb3xc+gVjJtmLsU 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 iQIcBAABCgAGBQJVDGBcAAoJEDhUsXb6ZiH/47UP+wUciigp+C9VXkG4ZUjsDXCp Q5N/XhcqsLbPGE3hXQWAe6lIPFxeLupt3KPEo9Z3uZjDWT0QXdWb6N5z8q88Npu7 L7WdGvWBMTSVPhowj3nNaeOfZKe/d8lNQf8R0wQAWC8yJ49FlO7c5bxiO6PIZwmL jX/lunZlSwJ9GrGG2OAdIXrkbwyh9v4YI25uv43Vs2Y1NZ5hgMq8yvK6bA6+uwSy yl2lkVc6d4DT0Br+I9xl7wXlI1tVMGhhi7Q2Jv/WntYJFa5e+kv9xgEON7pCkDjT Pz0Zi6AwKjduXaiW8Ae3ggQrIS4U1wmgzkO9XRv4G2i7/2T6EPrfoj4gCdxdnalS wcok97UFEUgWZ7wNPKKUljYRzHTxq9BxXlcfoz9IXa/suzgA1AwuwlRP9GdCOi/o UqRxPlxT/6buELjOCzYQ2XrIOUWu0HisxuBAkL7GWAH1NtDekw5748hG07ksq6iY FY48qdDHwIf0zLIN19joZwgiQ6efHeH+ZKmCxKTHdfMxtNRJ7aujoeePblex1FqH XIVgnNJBgDBA4jHy5IrGq27nf1T/LcieylhRzZb7iHjuS/p/MDodz/JyQpNPKmna PVTLVySt1R5f2Yht3lWNPV9ZHwjBLOcvrZC/z61NwpkVXUJg0td2tjZlJtzJzbfU jI3LQhwhRXyiZTjDmzPp =5CgR -----END PGP SIGNATURE----- --=-Yz/ToXb3xc+gVjJtmLsU-- --===============1779992937== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1779992937==--