From owner-freebsd-current@FreeBSD.ORG Thu Feb 26 18:35:59 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 163761065678 for ; Thu, 26 Feb 2009 18:35:59 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 5C9E38FC1B for ; Thu, 26 Feb 2009 18:35:58 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 26 Feb 2009 18:35:56 -0000 Received: from p54A3E686.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.230.134] by mail.gmx.net (mp056) with SMTP; 26 Feb 2009 19:35:56 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX18iHnl+WxUiKjqX0jqH3BZvp7xdZYa4CXyDhFW8P7 sz2BrZv/9mynhv Message-ID: <49A6E10B.3090004@gmx.de> Date: Thu, 26 Feb 2009 19:35:55 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Andrew Thompson References: <20090226020330.GC25211@citylink.fud.org.nz> <200902260948.31967.hselasky@c2i.net> <20090226165447.GA47932@citylink.fud.org.nz> In-Reply-To: <20090226165447.GA47932@citylink.fud.org.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.65 Cc: freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: USB devfs patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2009 18:35:59 -0000 Andrew Thompson schrieb: > On Thu, Feb 26, 2009 at 09:48:31AM +0100, Hans Petter Selasky wrote: >> On Thursday 26 February 2009, Andrew Thompson wrote: >>> http://people.freebsd.org/~thompsa/usb-cdevs.diff >> Hi, >> >> Here is a list of comments and bugs. >> The comments follow the diff from top to bottom. > > Thanks Hans, I will go through them all. > >> 6) Some non-gcc compilers will complain unless you do 0-1 when the >> destination variable is unsigned. >> >> - usb2_free_pipe_data(udev, iface_index, 0 - 1); >> + usb2_free_pipe_data(udev, iface_index, -1); > > This one in particular, if the variable is unsigned then you shouldnt > be passing a negative value. Either make signed or use ~0 for the max > value. Actually passing -1 has well defined semantics here (you get the maximum unsigned value after conversion, see §6.3.1.3:2) whereas ~0 doesn't.