From owner-freebsd-current@FreeBSD.ORG Mon Oct 7 19:04:43 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3E728C7 for ; Mon, 7 Oct 2013 19:04:43 +0000 (UTC) (envelope-from sean_bruno@yahoo.com) Received: from nm24-vm1.bullet.mail.gq1.yahoo.com (nm24-vm1.bullet.mail.gq1.yahoo.com [98.136.217.96]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94B042A22 for ; Mon, 7 Oct 2013 19:04:43 +0000 (UTC) Received: from [98.137.12.59] by nm24.bullet.mail.gq1.yahoo.com with NNFMP; 07 Oct 2013 19:04:37 -0000 Received: from [208.71.42.214] by tm4.bullet.mail.gq1.yahoo.com with NNFMP; 07 Oct 2013 19:04:37 -0000 Received: from [127.0.0.1] by smtp225.mail.gq1.yahoo.com with NNFMP; 07 Oct 2013 19:04:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1381172677; bh=zNOi59ZVnlKe1zzhY/rVzK/4O7FqQkDDiCWaucyvLjQ=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Subject:From:Reply-To:To:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-Mailer; b=k8WoP3MgQzd+x9RWJq8FOJzBMbAkU25IGIMKhfQfBRPtHNI06PthTt7Bo0Fu4kdpy6qEHeKGDW9xqp3jrecYIo+AdBdFkW7QHNMAuv3KutR5ld5aYwNc9qfCT3CSnRponRLcUWNss/M6J7PP16IfcEHHGXjdCjwoIKyTUgrJSM8= X-Yahoo-Newman-Id: 163444.62368.bm@smtp225.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ArHPTS0VM1kNXaER3aqdIWY5JEJkYUxboFPWmt8JAJHbZio 7PDLSEabnqAxdlCyRbuyffbAdusMN2JZ53zO1PAKCm0vxEXpEAak15CBZUms fbkCVHtTZjigQWZ9W8_d2Pta2sUZFO84Q60hu9LnkgrCkazY9fc13OoLGrN5 q.9eK8szRrGT6DeK.4MGSTiNhzPQNKtuzS_IDmON.YEFHRG357yUGGbNOAc2 8Scb0BQpeG_8n2onpaDuVpXZp0F.LIpnl7D_P1OeCjnZlWycU6oVMjABdlrI SZRbHRToAkwrdSNlHbjSc4Gi6kT7Rmu.jZxCTLboFS85SRAnjNHt5TayICci aJwsV3CNm7GfzaNJP_Xz5aAFuA9kMe_90Pp_oqmE0Huihlsq_5MjhxVyg.4t wxta9YCyWxnwXwS8qa_pri_k8bN8u9dR1Z7pmNBl7iv47BiQaJ9AMTITXiJz G.MH1aCEh663g8XsY1OpN3H1YF6Zc5j.tZemXHNFP2SnAlHUaVaNtYD4BcBu v9Oqpd9N4lw83Wh5688LoRCXFkbMS6_DqT_PXmXarhBXOmA1sjHce.PkeEJZ Kdo08h.NtJYDorc4RyHvC3TUfQZigaLzNq4nkrShsLLzEJ6KVuPicz9lL.Lg 0dij8t.QzaS5OLzAE7BYUcaVAm7fJN9Q6ZRE4YEK5uNHE9pia X-Yahoo-SMTP: u5BKR6OswBC_iZJVfGRoMkTIpc8pEA4- X-Rocket-Received: from [10.73.160.242] (sean_bruno@209.131.62.116 with ) by smtp225.mail.gq1.yahoo.com with SMTP; 07 Oct 2013 19:04:37 +0000 UTC Subject: [patch] Re: drm2/radeon dfixed_trunc() warnings From: Sean Bruno To: "freebsd-current@freebsd.org" In-Reply-To: <1381095549.1586.7.camel@localhost> References: <1381095549.1586.7.camel@localhost> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-KslReGfPW9C9628YLhIx" Date: Mon, 07 Oct 2013 12:04:36 -0700 Message-ID: <1381172676.3091.0.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 19:04:44 -0000 --=-KslReGfPW9C9628YLhIx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 --=-KslReGfPW9C9628YLhIx 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) iQEcBAABAgAGBQJSUwXBAAoJEBkJRdwI6BaHkV0H/2fKecxd9JKu/1Zsvh5bbqS+ uQYqab0ralSU39cuPCw1+aZ5hM08dBRsCoZS3uddC5GPRBYvvBIICxNVffuqfdSD RJPHFqSo/0wZhkcIFks/MbWSOUMBnsL/IbEu4Nrl6DXVbrJvs0KQuyBxvRkxi8LS ZBATQr6404rkqyi5si8rlpRl7ajQ02OB5f7N7GxwtBU8OkLi2LQPPb3xqiekhNc6 Ff/okihzRdyYeW5B10/wz5uHZkTmsNa7zun4k5aO50KzKh5hBk0DYiEjkGkhShLV tl2yF/TSk70CVlR62x7iZn+hgvcIbD80aEUFXAoCxgHqqQYfahKxfTKmBqqh6ns= =XVwr -----END PGP SIGNATURE----- --=-KslReGfPW9C9628YLhIx--