Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Oct 2013 16:39:36 -0700
From:      Sean Bruno <sean_bruno@yahoo.com>
To:        freebsd-X11@freebsd.org
Subject:   [patch] Re: drm2/radeon dfixed_trunc() warnings
Message-ID:  <1381189176.3399.4.camel@localhost>
In-Reply-To: <1381095549.1586.7.camel@localhost>
References:  <1381095549.1586.7.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-s8BvuewmrJOizElEsmSE
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

[repost from -current]

On Sun, 2013-10-06 at 14:39 -0700, Sean Bruno wrote:=20
> These caught my eye today, and the checks strewn about
> sys/dev/drm2/radeon seem completely bogus to me, but I don't have the
> h/w to test it at the moment.
>=20
> /usr/src/sys/modules/drm2/radeonkms/../../../dev/drm2/radeon/rs690.c:491:=
37: warning: comparison of unsigned expression < 0 is always false [-Wtauto=
logical-compare]
>                 if (dfixed_trunc(priority_mark02) < 0)
>=20
>=20
> dfixed_trunc is a macro:
> drm_fixed.h:#define dfixed_trunc(A) ((A).full >> 12)
>=20
> that returns the output of a shift right operation ... priority_mark02
> is of type union fixed20_12, single element union of type u32, so I
> can't see this check ever doing anything useful.
>=20
> But, as always, I'm probably missing something obvious. =20
>=20
> Sean


Proposed patch to eliminate this check.  If I understand the macro
correctly, there's no way for these checks to ever do anything as bit
shifting an unsigned will simply clear out the value.  So, the check for
<0 is completely bogus?

Sean

http://people.freebsd.org/~sbruno/drm2_radeon_useless.txt=20


--=-s8BvuewmrJOizElEsmSE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (FreeBSD)

iQEcBAABAgAGBQJSU0YwAAoJEBkJRdwI6BaHBXsIAIWcgw63yaI4r5eY/LHc4S7k
3qMhrIBqVHMTGEuAQhzvFQq8jNCyR2Yn0LayVDdsY8BwhQSumxEjKDgZcH5cmoy0
RHRt3MK+QCAg4HY0t948fEY3fkaNSjuUUnh78UrPWf6fagDILFpExqZEz2vy/1FW
0N4b4gI7slsvidxEnp6YO/5TQXBlsGBhPUsJ0mboSJ0Ah3dddVQX68TGTy/g5iqZ
7j78UAB6Nil019v2Ub1BcC67hfp3Yf9tFhYPqPXR3xz8RBmd1TDBQirerJkT0Wud
L6UykuknduUS/ciVffSzWelX6sDeeosQj9efgQ311HFv2JJZFBr6P8YUojAPPjE=
=6KtV
-----END PGP SIGNATURE-----

--=-s8BvuewmrJOizElEsmSE--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1381189176.3399.4.camel>