]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: simplify packet sequence number handling
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 14 May 2015 14:46:14 +0000 (10:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 May 2015 16:24:46 +0000 (12:24 -0400)
commit8986624d3c310afc65109a4ea328d270f4e940dd
treeae6a57dd200627e3a3226652700a4a3d6c3a59b3
parentd29ed788068553504f1fa829f99feb2de6f545e0
tipc: simplify packet sequence number handling

Although the sequence number in the TIPC protocol is 16 bits, we have
until now stored it internally as an unsigned 32 bits integer.
We got around this by always doing explicit modulo-65535 operations
whenever we need to access a sequence number.

We now make the incoming and outgoing sequence numbers to unsigned
16-bit integers, and remove the modulo operations where applicable.

We also move the arithmetic inline functions for 16 bit integers
to core.h, and the function buf_seqno() to msg.h, so they can easily
be accessed from anywhere in the code.

Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/core.h
net/tipc/link.c
net/tipc/link.h
net/tipc/msg.h