Staging: bcm: Simplified by using variables
authorMatthias Beyer <mail@beyermatthias.de>
Fri, 23 May 2014 20:23:43 +0000 (22:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 22:26:35 +0000 (07:26 +0900)
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/CmHost.c

index 59a3eb9001638a13b73fb9fdfd51a08cc74c36bc..181c4e9d94452d9666c12427086b149ee629d183 100644 (file)
@@ -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]);
                }
        }
 }