]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: simplify endianness handling in topology subscriber
authorJon Maloy <jon.maloy@ericsson.com>
Thu, 15 Feb 2018 09:40:46 +0000 (10:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Feb 2018 20:26:33 +0000 (15:26 -0500)
commit7ccecb4bdb9366a97f70ef3e04795a4efc5bee73
treeed564ee8b615b55e4569b38ea039e3eb89dccbe0
parentce120b1b5297966e00ea2948efa449f0f8471456
tipc: simplify endianness handling in topology subscriber

Because of the requirement for total distribution transparency, users
send subscriptions and receive topology events in their own host format.
It is up to the topology server to determine this format and do the
correct conversions to and from its own host format when needed.

Until now, this has been handled in a rather non-transparent way inside
the topology server and subscriber code, leading to unnecessary
complexity when creating subscriptions and issuing events.

We now improve this situation by adding two new macros, tipc_sub_read()
and tipc_evt_write(). Both those functions calculate the need for
conversion internally before performing their respective operations.
Hence, all handling of such conversions become transparent to the rest
of the code.

Acked-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/name_table.c
net/tipc/name_table.h
net/tipc/server.c
net/tipc/subscr.c
net/tipc/subscr.h