From owner-svn-src-all@FreeBSD.ORG Tue Jan 18 17:16:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC41D10656C7; Tue, 18 Jan 2011 17:16:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF0D8FC22; Tue, 18 Jan 2011 17:16:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3A93946B0C; Tue, 18 Jan 2011 12:16:13 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4E6218A009; Tue, 18 Jan 2011 12:16:03 -0500 (EST) From: John Baldwin To: Bruce Evans Date: Tue, 18 Jan 2011 12:15:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101181523.p0IFNGeB042079@svn.freebsd.org> <20110119035030.W2099@besplex.bde.org> In-Reply-To: <20110119035030.W2099@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101181215.46266.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 18 Jan 2011 12:16:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Roman Divacky Subject: Re: svn commit: r217538 - in head/sys/dev: buslogic cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:16:13 -0000 On Tuesday, January 18, 2011 12:00:44 pm Bruce Evans wrote: > On Tue, 18 Jan 2011, John Baldwin wrote: > > > Log: > > Remove some always-true comparisons. > > > > Submitted by: clang via rdivacky > > > > Modified: head/sys/dev/buslogic/bt.c > > ============================================================================== > > --- head/sys/dev/buslogic/bt.c Tue Jan 18 14:58:44 2011 (r217537) > > +++ head/sys/dev/buslogic/bt.c Tue Jan 18 15:23:16 2011 (r217538) > > @@ -975,7 +975,7 @@ bt_find_probe_range(int ioport, int *por > > int > > bt_iop_from_bio(isa_compat_io_t bio_index) > > { > > - if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS) > > + if (bio_index < BT_NUM_ISAPORTS) > > return (bt_board_ports[bio_index]); > > return (-1); > > } > > So, what guarantees that isa_compat_io_t is unsigned and will remain so? > Indexes should be ints, unless you want a sign morass. Gah, I trusted the clang warning too much. enum's are ints in C yes? So clang has a bug if it thinks an enum value cannot be negative. In practice all the callers of this routine do not pass in negative values, but the compiler shouldn't warn about enum's bogusly. Is clang assuming that only defined values for an enum are ever passed in? If so we probably don't want to turn that checking on for the kernel as we violate that in lots of places. -- John Baldwin