qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] bitops: fix types


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] bitops: fix types
Date: Mon, 09 Jul 2012 09:38:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 8 July 2012 13:12,  <address@hidden> wrote:
>> -static inline uint64_t deposit64(uint64_t value, int start, int length,
>> -                                 uint64_t fieldval)
>> +static inline uint64_t deposit64(uint64_t value, unsigned int start,
>> +                                 unsigned int length, uint64_t fieldval)
>>  {
>>      uint64_t mask;
>> -    assert(start >= 0 && length > 0 && length <= 64 - start);
>> +    assert(length > 0 && length <= 64 - start);
>
> This breaks the assertion (consider the case of start == UINT_MAX
> and length == 64).
>
> In general, this patch is fixing something that isn't broken
> and pointlessly diverging from the well-tested kernel versions
> of these functions. It's also trying to do several things at once
> (eg "drop volatile" is probably less controversial.)

Agree on all points.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]