diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2014-05-23 22:23:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-24 07:26:35 +0900 |
commit | cdc299b7a54d84d9485dfe50b3ef0f511db84d60 (patch) | |
tree | b1fa9aac3a4988ca1aeeb72cf1057e13a83fdce8 /drivers/staging/bcm/CmHost.c | |
parent | 311cb0786aae1c561608fbccb2d34e5a997c3d43 (diff) | |
download | op-kernel-dev-cdc299b7a54d84d9485dfe50b3ef0f511db84d60.zip op-kernel-dev-cdc299b7a54d84d9485dfe50b3ef0f511db84d60.tar.gz |
Staging: bcm: Simplified by using variables
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/bcm/CmHost.c')
-rw-r--r-- | drivers/staging/bcm/CmHost.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 59a3eb9..181c4e9 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -1923,13 +1923,16 @@ static void restore_endianess_of_pstClassifierEntry( enum bcm_ipaddr_context eIpAddrContext) { int i; + union u_ip_address *stSrc = &pstClassifierEntry->stSrcIpAddress; + union u_ip_address *stDest = &pstClassifierEntry->stDestIpAddress; + for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) { if (eIpAddrContext == eSrcIpAddress) { - pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]); - pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]); + stSrc->ulIpv6Addr[i] = ntohl(stSrc->ulIpv6Addr[i]); + stSrc->ulIpv6Mask[i] = ntohl(stSrc->ulIpv6Mask[i]); } else if (eIpAddrContext == eDestIpAddress) { - pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]); - pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]); + stDest->ulIpv6Addr[i] = ntohl(stDest->ulIpv6Addr[i]); + stDest->ulIpv6Mask[i] = ntohl(stDest->ulIpv6Mask[i]); } } } |