Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: bcm: PHSModule.c: Shortened lines

This patch shortenes all lines where possible without code refactoring,
as well as comment lines. It does not change the wording of comments.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Matthias Beyer and committed by
Greg Kroah-Hartman
e86bd61e 3be738ad

+89 -54
+89 -54
drivers/staging/bcm/PHSModule.c
··· 110 110 UINT unPhsOldHdrSize = 0; 111 111 UINT unPHSNewPktHeaderLen = 0; 112 112 /* Pointer to PHS IN Hdr Buffer */ 113 - PUCHAR pucPHSPktHdrInBuf = Adapter->stPhsTxContextInfo.ucaHdrSuppressionInBuf; 113 + PUCHAR pucPHSPktHdrInBuf = 114 + Adapter->stPhsTxContextInfo.ucaHdrSuppressionInBuf; 114 115 /* Pointer to PHS OUT Hdr Buffer */ 115 - PUCHAR pucPHSPktHdrOutBuf = Adapter->stPhsTxContextInfo.ucaHdrSuppressionOutBuf; 116 + PUCHAR pucPHSPktHdrOutBuf = 117 + Adapter->stPhsTxContextInfo.ucaHdrSuppressionOutBuf; 116 118 UINT usPacketType; 117 119 UINT BytesToRemove = 0; 118 120 bool bPHSI = 0; ··· 146 144 (unPHSPktHdrBytesCopied <= MAX_PHS_LENGTHS)) { 147 145 148 146 /* 149 - * Step 2 Suppress Header using PHS and fill into intermediate ucaPHSPktHdrOutBuf. 150 - * Suppress only if IP Header and PHS Enabled For the Service Flow 147 + * Step 2 Suppress Header using PHS and fill into intermediate 148 + * ucaPHSPktHdrOutBuf. 149 + * Suppress only if IP Header and PHS Enabled For the 150 + * Service Flow 151 151 */ 152 152 if (((usPacketType == ETHERNET_FRAMETYPE_IPV4) || 153 153 (usPacketType == ETHERNET_FRAMETYPE_IPV6)) && ··· 187 183 "PHS Sending packet Compressed"); 188 184 189 185 if (skb_cloned(Packet)) { 190 - newPacket = skb_copy(Packet, GFP_ATOMIC); 186 + newPacket = 187 + skb_copy(Packet, GFP_ATOMIC); 191 188 192 189 if (newPacket == NULL) 193 190 return STATUS_FAILURE; ··· 245 240 } 246 241 } 247 242 248 - /* BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_SEND, DBG_LVL_ALL,"PHSTransmit : Dumping data packet After PHS"); */ 243 + /* BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_SEND, DBG_LVL_ALL, 244 + * "PHSTransmit : Dumping data packet After PHS"); */ 249 245 return STATUS_SUCCESS; 250 246 } 251 247 ··· 327 321 /* 328 322 * Procedure: phs_init 329 323 * 330 - * Description: This routine is responsible for allocating memory for classifier and 331 - * PHS rules. 324 + * Description: This routine is responsible for allocating memory for classifier 325 + * and PHS rules. 332 326 * 333 327 * Arguments: 334 - * pPhsdeviceExtension - ptr to Device extension containing PHS Classifier rules and PHS Rules , RX, TX buffer etc 328 + * pPhsdeviceExtension - ptr to Device extension containing PHS Classifier rules 329 + * and PHS Rules , RX, TX buffer etc 335 330 * 336 331 * Returns: 337 332 * TRUE(1) -If allocation of memory was successful. ··· 445 438 UINT nSFIndex = 0; 446 439 struct bcm_phs_entry *pstServiceFlowEntry = NULL; 447 440 struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev); 448 - struct bcm_phs_extension *pDeviceExtension = (struct bcm_phs_extension *)pvContext; 441 + struct bcm_phs_extension *pDeviceExtension = 442 + (struct bcm_phs_extension *)pvContext; 449 443 450 444 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, 451 445 "PHS With Corr2 Changes\n"); ··· 563 555 * 0 if successful, 564 556 * >0 Error. 565 557 */ 566 - ULONG PhsDeleteClassifierRule(IN void *pvContext, IN B_UINT16 uiVcid, IN B_UINT16 uiClsId) 558 + ULONG PhsDeleteClassifierRule(IN void *pvContext, 559 + IN B_UINT16 uiVcid, 560 + IN B_UINT16 uiClsId) 567 561 { 568 562 UINT nSFIndex = 0, nClsidIndex = 0; 569 563 struct bcm_phs_entry *pstServiceFlowEntry = NULL; ··· 712 702 * Exported function to compress the data using PHS. 713 703 * 714 704 * Arguments: 715 - * IN void* pvContext - PHS Driver Specific Context. 716 - * IN B_UINT16 uiVcid - The Service Flow ID to which current packet header compression applies. 717 - * IN UINT uiClsId - The Classifier ID to which current packet header compression applies. 718 - * IN void *pvInputBuffer - The Input buffer containg packet header data 719 - * IN void *pvOutputBuffer - The output buffer returned by this function after PHS 720 - * IN UINT *pOldHeaderSize - The actual size of the header before PHS 721 - * IN UINT *pNewHeaderSize - The new size of the header after applying PHS 705 + * IN void* pvContext - PHS Driver Specific Context. 706 + * IN B_UINT16 uiVcid - The Service Flow ID to which current 707 + * packet header compression applies. 708 + * IN UINT uiClsId - The Classifier ID to which current packet 709 + * header compression applies. 710 + * IN void *pvInputBuffer - The Input buffer containg packet header 711 + * data 712 + * IN void *pvOutputBuffer - The output buffer returned by this 713 + * function after PHS 714 + * IN UINT *pOldHeaderSize - The actual size of the header before PHS 715 + * IN UINT *pNewHeaderSize - The new size of the header after applying 716 + * PHS 722 717 * 723 718 * Return Value: 724 719 * ··· 812 797 * Exported function to restore the packet header in Rx path. 813 798 * 814 799 * Arguments: 815 - * IN void* pvContext - PHS Driver Specific Context. 816 - * IN B_UINT16 uiVcid - The Service Flow ID to which current packet header restoration applies. 817 - * IN void *pvInputBuffer - The Input buffer containg suppressed packet header data 818 - * OUT void *pvOutputBuffer - The output buffer returned by this function after restoration 819 - * OUT UINT *pHeaderSize - The packet header size after restoration is returned in this parameter. 800 + * IN void* pvContext - PHS Driver Specific Context. 801 + * IN B_UINT16 uiVcid - The Service Flow ID to which current 802 + * packet header restoration applies. 803 + * IN void *pvInputBuffer - The Input buffer containg suppressed 804 + * packet header data 805 + * OUT void *pvOutputBuffer - The output buffer returned by this 806 + * function after restoration 807 + * OUT UINT *pHeaderSize - The packet header size after restoration 808 + * is returned in this parameter. 820 809 * 821 810 * Return Value: 822 811 * ··· 873 854 eActiveClassifierRuleContext, 874 855 &pstPhsRule); 875 856 if (nPhsRuleIndex == PHS_INVALID_TABLE_INDEX) { 876 - /* Phs Rule does not exist in active rules table. Lets try in the old rules table. */ 857 + /* Phs Rule does not exist in active rules table. Lets try 858 + * in the old rules table. */ 877 859 nPhsRuleIndex = GetPhsRuleEntry(pstServiceFlowEntry->pstClassifierTable, 878 860 phsi, 879 861 eOldClassifierRuleContext, ··· 897 877 /* 898 878 * Procedure: free_phs_serviceflow_rules 899 879 * 900 - * Description: This routine is responsible for freeing memory allocated for PHS rules. 880 + * Description: This routine is responsible for freeing memory allocated for 881 + * PHS rules. 901 882 * 902 883 * Arguments: 903 884 * rules - ptr to S_SERVICEFLOW_TABLE structure. ··· 1114 1093 1115 1094 if (nClassifierIndex == PHS_INVALID_TABLE_INDEX) { 1116 1095 /* 1117 - * The Classifier doesn't exist. So its a new classifier being added. 1096 + * The Classifier doesn't exist. So its a new classifier being 1097 + * added. 1118 1098 * Add new entry to associate PHS Rule to the Classifier 1119 1099 */ 1120 1100 ··· 1136 1114 return ERR_PHS_INVALID_PHS_RULE; 1137 1115 1138 1116 /* 1139 - * This rule already exists if any fields are changed for this PHS 1140 - * rule update them. 1117 + * This rule already exists if any fields are changed for this 1118 + * PHS rule update them. 1141 1119 */ 1142 1120 /* If any part of PHSF is valid then we update PHSF */ 1143 1121 if (psPhsRule->u8PHSFLength) { ··· 1245 1223 if (eClsContext == eActiveClassifierRuleContext) 1246 1224 return ERR_CLSASSIFIER_TABLE_FULL; 1247 1225 else { 1248 - /* Lets replace the oldest rule if we are looking in old Rule table */ 1226 + /* Lets replace the oldest rule if we are looking in 1227 + * old Rule table */ 1249 1228 if (psaClassifiertable->uiOldestPhsRuleIndex >= MAX_PHSRULE_PER_SF) 1250 1229 psaClassifiertable->uiOldestPhsRuleIndex = 0; 1251 1230 ··· 1307 1284 bPHSRuleOrphaned = DerefPhsRule(uiClsId, psaClassifiertable, 1308 1285 pstClassifierEntry->pstPhsRule); 1309 1286 1310 - /* Step 2 Search if there is a PHS Rule with u8AssociatedPHSI in Classifier table for this SF */ 1287 + /* Step 2 Search if there is a PHS Rule with u8AssociatedPHSI in 1288 + * Classifier table for this SF */ 1311 1289 nPhsRuleIndex = GetPhsRuleEntry(psaClassifiertable, u8AssociatedPHSI, 1312 1290 eActiveClassifierRuleContext, 1313 1291 &pstAddPhsRule); ··· 1324 1300 return ERR_PHS_INVALID_PHS_RULE; 1325 1301 } 1326 1302 1327 - /* Step 2.a PHS Rule Does Not Exist .Create New PHS Rule for uiClsId */ 1303 + /* Step 2.a PHS Rule Does Not Exist .Create New PHS Rule for 1304 + * uiClsId */ 1328 1305 if (false == bPHSRuleOrphaned) { 1329 1306 1330 1307 pstClassifierEntry->pstPhsRule = ··· 1337 1312 memcpy(pstClassifierEntry->pstPhsRule, psPhsRule, 1338 1313 sizeof(struct bcm_phs_rule)); 1339 1314 } else { 1340 - /* Step 2.b PHS Rule Exists Tie uiClsId with the existing PHS Rule */ 1315 + /* Step 2.b PHS Rule Exists Tie uiClsId with the existing 1316 + * PHS Rule */ 1341 1317 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, 1342 1318 DBG_LVL_ALL, 1343 1319 "\nTying Classifier to Existing PHS Rule"); ··· 1462 1436 * 1463 1437 * Arguments: 1464 1438 * in_buf - ptr to incoming packet buffer. 1465 - * out_buf - ptr to output buffer where the suppressed header is copied. 1466 - * decomp_phs_rules - ptr to PHS rule. 1467 - * header_size - ptr to field which holds the phss or phsf_length. 1439 + * out_buf - ptr to output buffer where the suppressed 1440 + * header is copied. 1441 + * decomp_phs_rules - ptr to PHS rule. 1442 + * header_size - ptr to field which holds the phss or 1443 + * phsf_length. 1468 1444 * 1469 1445 * Returns: 1470 - * size -The number of bytes of dynamic fields present with in the incoming packet 1471 - * header. 1472 - * 0 -If PHS rule is NULL.If PHSI is 0 indicateing packet as uncompressed. 1446 + * size - The number of bytes of dynamic fields present with in the 1447 + * incoming packet header. 1448 + * 0 - If PHS rule is NULL.If PHSI is 0 indicateing packet as 1449 + * uncompressed. 1473 1450 */ 1474 1451 static int phs_decompress(unsigned char *in_buf, 1475 1452 unsigned char *out_buf, ··· 1497 1468 1498 1469 tmp_memb = decomp_phs_rules; 1499 1470 /* 1500 - * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP:In phs_decompress PHSI 1 %d",phsi)); 1471 + * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL, 1472 + * "\nDECOMP:In phs_decompress PHSI 1 %d",phsi)); 1501 1473 * header_size = tmp_memb->u8PHSFLength; 1502 1474 */ 1503 1475 phss = tmp_memb->u8PHSS; ··· 1509 1479 phss = MAX_PHS_LENGTHS; 1510 1480 1511 1481 /* 1512 - * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL,"\nDECOMP: 1482 + * BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, PHS_RECEIVE,DBG_LVL_ALL, 1483 + * "\nDECOMP: 1513 1484 * In phs_decompress PHSI %d phss %d index %d",phsi,phss,index)); 1514 1485 */ 1515 1486 while ((phss > 0) && (size < in_buf_len)) { ··· 1549 1518 /* 1550 1519 * Procedure: phs_compress 1551 1520 * 1552 - * Description: This routine suppresses the static fields within the packet.Before 1553 - * that it will verify the fields to be suppressed with the corresponding fields in the 1554 - * phsf. For verification it checks the phsv field of PHS rule. If set and verification 1555 - * succeeds it suppresses the field.If any one static field is found different none of 1556 - * the static fields are suppressed then the packet is sent as uncompressed packet with 1557 - * phsi=0. 1521 + * Description: This routine suppresses the static fields within the packet. 1522 + * Before that it will verify the fields to be suppressed with the corresponding 1523 + * fields in the phsf. For verification it checks the phsv field of PHS rule. 1524 + * If set and verification succeeds it suppresses the field.If any one static 1525 + * field is found different none of the static fields are suppressed then the 1526 + * packet is sent as uncompressed packet with phsi=0. 1558 1527 * 1559 1528 * Arguments: 1560 1529 * phs_rule - ptr to PHS rule. 1561 1530 * in_buf - ptr to incoming packet buffer. 1562 - * out_buf - ptr to output buffer where the suppressed header is copied. 1531 + * out_buf - ptr to output buffer where the suppressed header is 1532 + * copied. 1563 1533 * header_size - ptr to field which holds the phss. 1564 1534 * 1565 1535 * Returns: 1566 - * size-The number of bytes copied into the output buffer i.e dynamic fields 1567 - * 0 -If PHS rule is NULL.If PHSV field is not set.If the verification fails. 1536 + * size - The number of bytes copied into the output buffer i.e 1537 + * dynamic fields 1538 + * 0 - If PHS rule is NULL.If PHSV field is not set. If the 1539 + * verification fails. 1568 1540 */ 1569 1541 static int phs_compress(struct bcm_phs_rule *phs_rule, 1570 1542 unsigned char *in_buf, ··· 1622 1588 * rules_set - ptr to classifier_rules. 1623 1589 * in_buffer - ptr to incoming packet buffer. 1624 1590 * out_buffer - ptr to output buffer where the suppressed header is copied. 1625 - * phsf - ptr to phsf. 1626 - * phsm - ptr to phsm. 1627 - * phss - variable holding phss. 1591 + * phsf - ptr to phsf. 1592 + * phsm - ptr to phsm. 1593 + * phss - variable holding phss. 1628 1594 * 1629 1595 * Returns: 1630 - * size-The number of bytes copied into the output buffer i.e dynamic fields. 1631 - * 0 -Packet has failed the verification. 1596 + * size - The number of bytes copied into the output buffer i.e dynamic 1597 + * fields. 1598 + * 0 - Packet has failed the verification. 1632 1599 */ 1633 1600 static int verify_suppress_phsf(unsigned char *in_buffer, 1634 1601 unsigned char *out_buffer,