From: Matthias Beyer Date: Fri, 23 May 2014 20:24:02 +0000 (+0200) Subject: Staging: bcm: Shortened lines in CopyIpAddrToClassifier() X-Git-Tag: next-20140530~19^2~282 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e61f63557bcbe7bc036048c4f2b8391eb2134423;p=karo-tx-linux.git Staging: bcm: Shortened lines in CopyIpAddrToClassifier() Signed-off-by: Matthias Beyer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 7fb8568ad270..5bd6e1c12a8a 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -136,7 +136,8 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry, nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES; /* Destination Ip Address */ - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Address Range Length:0x%X ", u8IpAddressLen); + 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) { @@ -152,39 +153,61 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry, * (nSizeOfIPAddressInBytes for address and nSizeOfIPAddressInBytes for mask) */ if (eIpAddrContext == eDestIpAddress) { - pstClassifierEntry->ucIPDestinationAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); + pstClassifierEntry->ucIPDestinationAddressLength = + u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); if (bIpVersion6) { - ptrClassifierIpAddress = st_dest_ip->ucIpv6Address; - ptrClassifierIpMask = st_dest_ip->ucIpv6Mask; + ptrClassifierIpAddress = + st_dest_ip->ucIpv6Address; + ptrClassifierIpMask = + st_dest_ip->ucIpv6Mask; } else { - ptrClassifierIpAddress = st_dest_ip->ucIpv4Address; - ptrClassifierIpMask = st_dest_ip->ucIpv4Mask; + ptrClassifierIpAddress = + st_dest_ip->ucIpv4Address; + ptrClassifierIpMask = + st_dest_ip->ucIpv4Mask; } } else if (eIpAddrContext == eSrcIpAddress) { - pstClassifierEntry->ucIPSourceAddressLength = u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); + pstClassifierEntry->ucIPSourceAddressLength = + u8IpAddressLen/(nSizeOfIPAddressInBytes * 2); if (bIpVersion6) { - ptrClassifierIpAddress = st_src_ip->ucIpv6Address; + ptrClassifierIpAddress = + st_src_ip->ucIpv6Address; ptrClassifierIpMask = st_src_ip->ucIpv6Mask; } else { - ptrClassifierIpAddress = st_src_ip->ucIpv4Address; + 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); - while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) && (i < MAX_IP_RANGE_LENGTH)) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, + "Address Length:0x%X\n", + pstClassifierEntry->ucIPDestinationAddressLength); + while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) + && (i < MAX_IP_RANGE_LENGTH)) { memcpy(ptrClassifierIpAddress + (i * nSizeOfIPAddressInBytes), - (pu8IpAddressMaskSrc+(i*nSizeOfIPAddressInBytes*2)), + (pu8IpAddressMaskSrc + + (i * nSizeOfIPAddressInBytes * 2)), nSizeOfIPAddressInBytes); if (!bIpVersion6) { if (eIpAddrContext == eSrcIpAddress) { - 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 ", + 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 ", st_src_ip->ulIpv4Addr[i]); } else if (eIpAddrContext == eDestIpAddress) { - 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 ", + 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 ", st_dest_ip->ulIpv4Addr[i]); } } @@ -192,20 +215,29 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry, if (u8IpAddressLen >= nSizeOfIPAddressInBytes) { memcpy(ptrClassifierIpMask + (i * nSizeOfIPAddressInBytes), - (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes + - (i*nSizeOfIPAddressInBytes*2)), + (pu8IpAddressMaskSrc + + nSizeOfIPAddressInBytes + + (i * nSizeOfIPAddressInBytes * 2)), nSizeOfIPAddressInBytes); if (!bIpVersion6) { if (eIpAddrContext == eSrcIpAddress) { 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 ", + BCM_DEBUG_PRINT(Adapter, + DBG_TYPE_OTHERS, + CONN_MSG, + DBG_LVL_ALL, + "Src Ip Mask Address:0x%luX ", st_src_ip->ulIpv4Mask[i]); } else if (eIpAddrContext == eDestIpAddress) { 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 ", + BCM_DEBUG_PRINT(Adapter, + DBG_TYPE_OTHERS, + CONN_MSG, + DBG_LVL_ALL, + "Dest Ip Mask Address:0x%luX ", st_dest_ip->ulIpv4Mask[i]); } }