tipc: eliminate code duplication in media layer
authorYing Xue <ying.xue@windriver.com>
Wed, 11 Dec 2013 04:45:43 +0000 (20:45 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2013 05:17:43 +0000 (00:17 -0500)
commite4d050cbf7720d8bcc781f4ef557d37ed148a5c4
tree57e491fae1ead5a0c587c1085266dbdbb9d30f45
parent6e967adf798ae5066488fd0c2b2466d06c642f23
tipc: eliminate code duplication in media layer

Currently TIPC supports two L2 media types, Ethernet and Infiniband.
Because both these media are accessed through the common net_device API,
several functions in the two media adaptation files turn out to be
fully or almost identical, leading to unnecessary code duplication.

In this commit we extract this common code from the two media files
and move them to the generic bearer.c. Additionally, we change
the function names to reflect their real role: to access L2 media,
irrespective of type.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Cc: Patrick McHardy <kaber@trash.net>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c
net/tipc/bearer.h
net/tipc/eth_media.c
net/tipc/ib_media.c