Date: Mon, 07 Oct 2013 12:04:36 -0700 From: Sean Bruno <sean_bruno@yahoo.com> To: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: [patch] Re: drm2/radeon dfixed_trunc() warnings Message-ID: <1381172676.3091.0.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
[-- Attachment #1 --] On Sun, 2013-10-06 at 14:39 -0700, Sean Bruno wrote: > 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. > > /usr/src/sys/modules/drm2/radeonkms/../../../dev/drm2/radeon/rs690.c:491:37: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] > if (dfixed_trunc(priority_mark02) < 0) > > > dfixed_trunc is a macro: > drm_fixed.h:#define dfixed_trunc(A) ((A).full >> 12) > > 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. > > But, as always, I'm probably missing something obvious. > > 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 [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (FreeBSD) iQEcBAABAgAGBQJSUwXBAAoJEBkJRdwI6BaHkV0H/2fKecxd9JKu/1Zsvh5bbqS+ uQYqab0ralSU39cuPCw1+aZ5hM08dBRsCoZS3uddC5GPRBYvvBIICxNVffuqfdSD RJPHFqSo/0wZhkcIFks/MbWSOUMBnsL/IbEu4Nrl6DXVbrJvs0KQuyBxvRkxi8LS ZBATQr6404rkqyi5si8rlpRl7ajQ02OB5f7N7GxwtBU8OkLi2LQPPb3xqiekhNc6 Ff/okihzRdyYeW5B10/wz5uHZkTmsNa7zun4k5aO50KzKh5hBk0DYiEjkGkhShLV tl2yF/TSk70CVlR62x7iZn+hgvcIbD80aEUFXAoCxgHqqQYfahKxfTKmBqqh6ns= =XVwr -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1381172676.3091.0.camel>
