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
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
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
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 reduce the
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
assigning an
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 mark.d.rus...@intel.com
---
include/scsi/iscsi_proto.h | 21