Staging: bcm: Replaced member accessing by variable
authorMatthias Beyer <mail@beyermatthias.de>
Fri, 23 May 2014 20:24:01 +0000 (22:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 22:26:38 +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 d5d5a9fb73bfe7297f97ec35eed5d6296e3f0362..7fb8568ad2700ff7f74de12fb274b91c4df691f6 100644 (file)
@@ -139,6 +139,13 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry,
        BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Address Range Length:0x%X ", u8IpAddressLen);
        if ((bIpVersion6 ? (IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2) :
                        (TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen) {
+
+               union u_ip_address *st_dest_ip =
+                       &pstClassifierEntry->stDestIpAddress;
+
+               union u_ip_address *st_src_ip =
+                       &pstClassifierEntry->stSrcIpAddress;
+
                /*
                 * checking both the mask and address togethor in Classification.
                 * So length will be : TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
@@ -147,20 +154,20 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry,
                if (eIpAddrContext == eDestIpAddress) {
                        pstClassifierEntry->ucIPDestinationAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
                        if (bIpVersion6) {
-                               ptrClassifierIpAddress = pstClassifierEntry->stDestIpAddress.ucIpv6Address;
-                               ptrClassifierIpMask = pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
+                               ptrClassifierIpAddress = st_dest_ip->ucIpv6Address;
+                               ptrClassifierIpMask = st_dest_ip->ucIpv6Mask;
                        } else {
-                               ptrClassifierIpAddress = pstClassifierEntry->stDestIpAddress.ucIpv4Address;
-                               ptrClassifierIpMask = pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
+                               ptrClassifierIpAddress = st_dest_ip->ucIpv4Address;
+                               ptrClassifierIpMask = st_dest_ip->ucIpv4Mask;
                        }
                } else if (eIpAddrContext == eSrcIpAddress) {
                        pstClassifierEntry->ucIPSourceAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
                        if (bIpVersion6) {
-                               ptrClassifierIpAddress = pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
-                               ptrClassifierIpMask = pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
+                               ptrClassifierIpAddress = st_src_ip->ucIpv6Address;
+                               ptrClassifierIpMask = st_src_ip->ucIpv6Mask;
                        } else {
-                               ptrClassifierIpAddress = pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
-                               ptrClassifierIpMask = pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
+                               ptrClassifierIpAddress = st_src_ip->ucIpv4Address;
+                               ptrClassifierIpMask = st_src_ip->ucIpv4Mask;
                        }
                }
                BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Address Length:0x%X\n", pstClassifierEntry->ucIPDestinationAddressLength);
@@ -172,13 +179,13 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry,
 
                        if (!bIpVersion6) {
                                if (eIpAddrContext == eSrcIpAddress) {
-                                       pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
+                                       st_src_ip->ulIpv4Addr[i] = ntohl(st_src_ip->ulIpv4Addr[i]);
                                        BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ",
-                                                       pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
+                                                       st_src_ip->ulIpv4Addr[i]);
                                } else if (eIpAddrContext == eDestIpAddress) {
-                                       pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
+                                       st_dest_ip->ulIpv4Addr[i] = ntohl(st_dest_ip->ulIpv4Addr[i]);
                                        BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Address:0x%luX ",
-                                                       pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
+                                                       st_dest_ip->ulIpv4Addr[i]);
                                }
                        }
                        u8IpAddressLen -= nSizeOfIPAddressInBytes;
@@ -191,15 +198,15 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry,
 
                                if (!bIpVersion6) {
                                        if (eIpAddrContext == eSrcIpAddress) {
-                                               pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i] =
-                                                       ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]);
+                                               st_src_ip->ulIpv4Mask[i] =
+                                                       ntohl(st_src_ip->ulIpv4Mask[i]);
                                                BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Mask Address:0x%luX ",
-                                                               pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]);
+                                                               st_src_ip->ulIpv4Mask[i]);
                                        } else if (eIpAddrContext == eDestIpAddress) {
-                                               pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i] =
-                                                       ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]);
+                                               st_dest_ip->ulIpv4Mask[i] =
+                                                       ntohl(st_dest_ip->ulIpv4Mask[i]);
                                                BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Mask Address:0x%luX ",
-                                                               pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]);
+                                                               st_dest_ip->ulIpv4Mask[i]);
                                        }
                                }
                                u8IpAddressLen -= nSizeOfIPAddressInBytes;