On Thu, 2011-04-07 at 14:26 -0700, Mark Rustad wrote:
> Unsigned serial number comparison is very simple if you simply put the
> difference into a signed integer of the same size and then compare that
> value with zero. All the complexity and confusion fall away.
>
> Signed-off-by: Mark Rustad
>
On Apr 8, 2011, at 10:28 AM, Paul Koning wrote:
> On Apr 8, 2011, at 1:22 PM, Rustad, Mark D wrote:
>
>> Ulrich,
>>
>> On Apr 7, 2011, at 11:35 PM, Ulrich Windl wrote:
>>
>>> I just wonder how safe the code is:
>>>
>>> Doesn't the difference of two unsigned ints give an unsigned value? The
>>
On Apr 8, 2011, at 1:22 PM, Rustad, Mark D wrote:
> Ulrich,
>
> On Apr 7, 2011, at 11:35 PM, Ulrich Windl wrote:
>
>> I just wonder how safe the code is:
>>
>> Doesn't the difference of two unsigned ints give an unsigned value? The
>> assigning an unsigned int to a signed int will definitely
Ulrich,
On Apr 7, 2011, at 11:35 PM, Ulrich Windl wrote:
> I just wonder how safe the code is:
>
> Doesn't the difference of two unsigned ints give an unsigned value? The
> assigning an unsigned int to a signed int will definitely reduce the range...
Actually, that isn't true. There are 2^32 p
Hi!
I just wonder how safe the code is:
Doesn't the difference of two unsigned ints give an unsigned value? The
assigning an unsigned int to a signed int will definitely reduce the range...
I feel that
s32 diff = (s32) n1 - (s32) n2;
also doesn't make the problem go away, unless ypou promot
Unsigned serial number comparison is very simple if you simply put the
difference into a signed integer of the same size and then compare that
value with zero. All the complexity and confusion fall away.
Signed-off-by: Mark Rustad
---
include/scsi/iscsi_proto.h | 21 -
1 fi