Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Feb 2009 19:35:55 +0100
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        Andrew Thompson <thompsa@FreeBSD.org>
Cc:        freebsd-current@freebsd.org, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: USB devfs patch
Message-ID:  <49A6E10B.3090004@gmx.de>
In-Reply-To: <20090226165447.GA47932@citylink.fud.org.nz>
References:  <20090226020330.GC25211@citylink.fud.org.nz>	<200902260948.31967.hselasky@c2i.net> <20090226165447.GA47932@citylink.fud.org.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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