diff options
author | Joe Perches <joe@perches.com> | 2012-02-19 22:52:38 -0500 |
---|---|---|
committer | Joe Perches <joe@perches.com> | 2012-02-21 12:04:01 -0500 |
commit | 475be4d85a274d0961593db41cf85689db1d583c (patch) | |
tree | b2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/hisax/q931.c | |
parent | 0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff) |
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style.
Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.
Done with emacs and some scripts and some typing.
Built x86 allyesconfig.
No detected change in objdump -d or size.
Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/hisax/q931.c')
-rw-r--r-- | drivers/isdn/hisax/q931.c | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c index c0771f98fa11..041bf52d9d0a 100644 --- a/drivers/isdn/hisax/q931.c +++ b/drivers/isdn/hisax/q931.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "l3_1tr6.h" | 21 | #include "l3_1tr6.h" |
22 | 22 | ||
23 | void | 23 | void |
24 | iecpy(u_char * dest, u_char * iestart, int ieoffset) | 24 | iecpy(u_char *dest, u_char *iestart, int ieoffset) |
25 | { | 25 | { |
26 | u_char *p; | 26 | u_char *p; |
27 | int l; | 27 | int l; |
@@ -215,7 +215,7 @@ prbits(char *dest, u_char b, int start, int len) | |||
215 | 215 | ||
216 | static | 216 | static |
217 | u_char * | 217 | u_char * |
218 | skipext(u_char * p) | 218 | skipext(u_char *p) |
219 | { | 219 | { |
220 | while (!(*p++ & 0x80)); | 220 | while (!(*p++ & 0x80)); |
221 | return (p); | 221 | return (p); |
@@ -442,7 +442,7 @@ struct CauseValue { | |||
442 | 442 | ||
443 | static | 443 | static |
444 | int | 444 | int |
445 | prcause(char *dest, u_char * p) | 445 | prcause(char *dest, u_char *p) |
446 | { | 446 | { |
447 | u_char *end; | 447 | u_char *end; |
448 | char *dp = dest; | 448 | char *dp = dest; |
@@ -519,7 +519,7 @@ struct MessageType cause_1tr6[] = | |||
519 | static int cause_1tr6_len = ARRAY_SIZE(cause_1tr6); | 519 | static int cause_1tr6_len = ARRAY_SIZE(cause_1tr6); |
520 | 520 | ||
521 | static int | 521 | static int |
522 | prcause_1tr6(char *dest, u_char * p) | 522 | prcause_1tr6(char *dest, u_char *p) |
523 | { | 523 | { |
524 | char *dp = dest; | 524 | char *dp = dest; |
525 | int i, cause; | 525 | int i, cause; |
@@ -554,7 +554,7 @@ prcause_1tr6(char *dest, u_char * p) | |||
554 | } | 554 | } |
555 | 555 | ||
556 | static int | 556 | static int |
557 | prchident(char *dest, u_char * p) | 557 | prchident(char *dest, u_char *p) |
558 | { | 558 | { |
559 | char *dp = dest; | 559 | char *dp = dest; |
560 | 560 | ||
@@ -566,7 +566,7 @@ prchident(char *dest, u_char * p) | |||
566 | } | 566 | } |
567 | 567 | ||
568 | static int | 568 | static int |
569 | prcalled(char *dest, u_char * p) | 569 | prcalled(char *dest, u_char *p) |
570 | { | 570 | { |
571 | int l; | 571 | int l; |
572 | char *dp = dest; | 572 | char *dp = dest; |
@@ -583,7 +583,7 @@ prcalled(char *dest, u_char * p) | |||
583 | return (dp - dest); | 583 | return (dp - dest); |
584 | } | 584 | } |
585 | static int | 585 | static int |
586 | prcalling(char *dest, u_char * p) | 586 | prcalling(char *dest, u_char *p) |
587 | { | 587 | { |
588 | int l; | 588 | int l; |
589 | char *dp = dest; | 589 | char *dp = dest; |
@@ -610,7 +610,7 @@ prcalling(char *dest, u_char * p) | |||
610 | 610 | ||
611 | static | 611 | static |
612 | int | 612 | int |
613 | prbearer(char *dest, u_char * p) | 613 | prbearer(char *dest, u_char *p) |
614 | { | 614 | { |
615 | char *dp = dest, ch; | 615 | char *dp = dest, ch; |
616 | 616 | ||
@@ -658,7 +658,7 @@ prbearer(char *dest, u_char * p) | |||
658 | 658 | ||
659 | static | 659 | static |
660 | int | 660 | int |
661 | prbearer_ni1(char *dest, u_char * p) | 661 | prbearer_ni1(char *dest, u_char *p) |
662 | { | 662 | { |
663 | char *dp = dest; | 663 | char *dp = dest; |
664 | u_char len; | 664 | u_char len; |
@@ -668,46 +668,46 @@ prbearer_ni1(char *dest, u_char * p) | |||
668 | dp += sprintf(dp, " octet 3 "); | 668 | dp += sprintf(dp, " octet 3 "); |
669 | dp += prbits(dp, *p, 8, 8); | 669 | dp += prbits(dp, *p, 8, 8); |
670 | switch (*p++) { | 670 | switch (*p++) { |
671 | case 0x80: | 671 | case 0x80: |
672 | dp += sprintf(dp, " Speech"); | 672 | dp += sprintf(dp, " Speech"); |
673 | break; | 673 | break; |
674 | case 0x88: | 674 | case 0x88: |
675 | dp += sprintf(dp, " Unrestricted digital information"); | 675 | dp += sprintf(dp, " Unrestricted digital information"); |
676 | break; | 676 | break; |
677 | case 0x90: | 677 | case 0x90: |
678 | dp += sprintf(dp, " 3.1 kHz audio"); | 678 | dp += sprintf(dp, " 3.1 kHz audio"); |
679 | break; | 679 | break; |
680 | default: | 680 | default: |
681 | dp += sprintf(dp, " Unknown information-transfer capability"); | 681 | dp += sprintf(dp, " Unknown information-transfer capability"); |
682 | } | 682 | } |
683 | *dp++ = '\n'; | 683 | *dp++ = '\n'; |
684 | dp += sprintf(dp, " octet 4 "); | 684 | dp += sprintf(dp, " octet 4 "); |
685 | dp += prbits(dp, *p, 8, 8); | 685 | dp += prbits(dp, *p, 8, 8); |
686 | switch (*p++) { | 686 | switch (*p++) { |
687 | case 0x90: | 687 | case 0x90: |
688 | dp += sprintf(dp, " 64 kbps, circuit mode"); | 688 | dp += sprintf(dp, " 64 kbps, circuit mode"); |
689 | break; | 689 | break; |
690 | case 0xc0: | 690 | case 0xc0: |
691 | dp += sprintf(dp, " Packet mode"); | 691 | dp += sprintf(dp, " Packet mode"); |
692 | break; | 692 | break; |
693 | default: | 693 | default: |
694 | dp += sprintf(dp, " Unknown transfer mode"); | 694 | dp += sprintf(dp, " Unknown transfer mode"); |
695 | } | 695 | } |
696 | *dp++ = '\n'; | 696 | *dp++ = '\n'; |
697 | if (len > 2) { | 697 | if (len > 2) { |
698 | dp += sprintf(dp, " octet 5 "); | 698 | dp += sprintf(dp, " octet 5 "); |
699 | dp += prbits(dp, *p, 8, 8); | 699 | dp += prbits(dp, *p, 8, 8); |
700 | switch (*p++) { | 700 | switch (*p++) { |
701 | case 0x21: | 701 | case 0x21: |
702 | dp += sprintf(dp, " Rate adaption\n"); | 702 | dp += sprintf(dp, " Rate adaption\n"); |
703 | dp += sprintf(dp, " octet 5a "); | 703 | dp += sprintf(dp, " octet 5a "); |
704 | dp += prbits(dp, *p, 8, 8); | 704 | dp += prbits(dp, *p, 8, 8); |
705 | break; | 705 | break; |
706 | case 0xa2: | 706 | case 0xa2: |
707 | dp += sprintf(dp, " u-law"); | 707 | dp += sprintf(dp, " u-law"); |
708 | break; | 708 | break; |
709 | default: | 709 | default: |
710 | dp += sprintf(dp, " Unknown UI layer 1 protocol"); | 710 | dp += sprintf(dp, " Unknown UI layer 1 protocol"); |
711 | } | 711 | } |
712 | *dp++ = '\n'; | 712 | *dp++ = '\n'; |
713 | } | 713 | } |
@@ -715,7 +715,7 @@ prbearer_ni1(char *dest, u_char * p) | |||
715 | } | 715 | } |
716 | 716 | ||
717 | static int | 717 | static int |
718 | general(char *dest, u_char * p) | 718 | general(char *dest, u_char *p) |
719 | { | 719 | { |
720 | char *dp = dest; | 720 | char *dp = dest; |
721 | char ch = ' '; | 721 | char ch = ' '; |
@@ -742,7 +742,7 @@ general(char *dest, u_char * p) | |||
742 | } | 742 | } |
743 | 743 | ||
744 | static int | 744 | static int |
745 | general_ni1(char *dest, u_char * p) | 745 | general_ni1(char *dest, u_char *p) |
746 | { | 746 | { |
747 | char *dp = dest; | 747 | char *dp = dest; |
748 | char ch = ' '; | 748 | char ch = ' '; |
@@ -769,7 +769,7 @@ general_ni1(char *dest, u_char * p) | |||
769 | } | 769 | } |
770 | 770 | ||
771 | static int | 771 | static int |
772 | prcharge(char *dest, u_char * p) | 772 | prcharge(char *dest, u_char *p) |
773 | { | 773 | { |
774 | char *dp = dest; | 774 | char *dp = dest; |
775 | int l; | 775 | int l; |
@@ -786,7 +786,7 @@ prcharge(char *dest, u_char * p) | |||
786 | return (dp - dest); | 786 | return (dp - dest); |
787 | } | 787 | } |
788 | static int | 788 | static int |
789 | prtext(char *dest, u_char * p) | 789 | prtext(char *dest, u_char *p) |
790 | { | 790 | { |
791 | char *dp = dest; | 791 | char *dp = dest; |
792 | int l; | 792 | int l; |
@@ -802,7 +802,7 @@ prtext(char *dest, u_char * p) | |||
802 | } | 802 | } |
803 | 803 | ||
804 | static int | 804 | static int |
805 | prfeatureind(char *dest, u_char * p) | 805 | prfeatureind(char *dest, u_char *p) |
806 | { | 806 | { |
807 | char *dp = dest; | 807 | char *dp = dest; |
808 | 808 | ||
@@ -817,21 +817,21 @@ prfeatureind(char *dest, u_char * p) | |||
817 | } | 817 | } |
818 | dp += sprintf(dp, " Status: "); | 818 | dp += sprintf(dp, " Status: "); |
819 | switch (*p) { | 819 | switch (*p) { |
820 | case 0: | 820 | case 0: |
821 | dp += sprintf(dp, "Idle"); | 821 | dp += sprintf(dp, "Idle"); |
822 | break; | 822 | break; |
823 | case 1: | 823 | case 1: |
824 | dp += sprintf(dp, "Active"); | 824 | dp += sprintf(dp, "Active"); |
825 | break; | 825 | break; |
826 | case 2: | 826 | case 2: |
827 | dp += sprintf(dp, "Prompt"); | 827 | dp += sprintf(dp, "Prompt"); |
828 | break; | 828 | break; |
829 | case 3: | 829 | case 3: |
830 | dp += sprintf(dp, "Pending"); | 830 | dp += sprintf(dp, "Pending"); |
831 | break; | 831 | break; |
832 | default: | 832 | default: |
833 | dp += sprintf(dp, "(Reserved)"); | 833 | dp += sprintf(dp, "(Reserved)"); |
834 | break; | 834 | break; |
835 | } | 835 | } |
836 | *dp++ = '\n'; | 836 | *dp++ = '\n'; |
837 | return (dp - dest); | 837 | return (dp - dest); |
@@ -868,7 +868,7 @@ struct DTag { /* Display tags */ | |||
868 | #define DTAGSIZE ARRAY_SIZE(dtaglist) | 868 | #define DTAGSIZE ARRAY_SIZE(dtaglist) |
869 | 869 | ||
870 | static int | 870 | static int |
871 | disptext_ni1(char *dest, u_char * p) | 871 | disptext_ni1(char *dest, u_char *p) |
872 | { | 872 | { |
873 | char *dp = dest; | 873 | char *dp = dest; |
874 | int l, tag, len, i; | 874 | int l, tag, len, i; |
@@ -902,12 +902,12 @@ disptext_ni1(char *dest, u_char * p) | |||
902 | *dp++ = *p++; | 902 | *dp++ = *p++; |
903 | } | 903 | } |
904 | dp += sprintf(dp, "\n"); | 904 | dp += sprintf(dp, "\n"); |
905 | } | 905 | } |
906 | } | 906 | } |
907 | return (dp - dest); | 907 | return (dp - dest); |
908 | } | 908 | } |
909 | static int | 909 | static int |
910 | display(char *dest, u_char * p) | 910 | display(char *dest, u_char *p) |
911 | { | 911 | { |
912 | char *dp = dest; | 912 | char *dp = dest; |
913 | char ch = ' '; | 913 | char ch = ' '; |
@@ -936,7 +936,7 @@ display(char *dest, u_char * p) | |||
936 | } | 936 | } |
937 | 937 | ||
938 | static int | 938 | static int |
939 | prfacility(char *dest, u_char * p) | 939 | prfacility(char *dest, u_char *p) |
940 | { | 940 | { |
941 | char *dp = dest; | 941 | char *dp = dest; |
942 | int l, l2; | 942 | int l, l2; |
@@ -1148,7 +1148,7 @@ static struct InformationElement we_6[] = | |||
1148 | #define WE_6_LEN ARRAY_SIZE(we_6) | 1148 | #define WE_6_LEN ARRAY_SIZE(we_6) |
1149 | 1149 | ||
1150 | int | 1150 | int |
1151 | QuickHex(char *txt, u_char * p, int cnt) | 1151 | QuickHex(char *txt, u_char *p, int cnt) |
1152 | { | 1152 | { |
1153 | register int i; | 1153 | register int i; |
1154 | register char *t = txt; | 1154 | register char *t = txt; |
@@ -1163,7 +1163,7 @@ QuickHex(char *txt, u_char * p, int cnt) | |||
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | void | 1165 | void |
1166 | LogFrame(struct IsdnCardState *cs, u_char * buf, int size) | 1166 | LogFrame(struct IsdnCardState *cs, u_char *buf, int size) |
1167 | { | 1167 | { |
1168 | char *dp; | 1168 | char *dp; |
1169 | 1169 | ||
@@ -1206,7 +1206,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1206 | buf = skb->data; | 1206 | buf = skb->data; |
1207 | dp += sprintf(dp, "frame %s ", dir ? "network->user" : "user->network"); | 1207 | dp += sprintf(dp, "frame %s ", dir ? "network->user" : "user->network"); |
1208 | size = skb->len; | 1208 | size = skb->len; |
1209 | 1209 | ||
1210 | if (tei == GROUP_TEI) { | 1210 | if (tei == GROUP_TEI) { |
1211 | if (sapi == CTRL_SAPI) { /* sapi 0 */ | 1211 | if (sapi == CTRL_SAPI) { /* sapi 0 */ |
1212 | if (ftyp == 3) { | 1212 | if (ftyp == 3) { |
@@ -1291,28 +1291,28 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1291 | /* Is it a single octet information element? */ | 1291 | /* Is it a single octet information element? */ |
1292 | if (*buf & 0x80) { | 1292 | if (*buf & 0x80) { |
1293 | switch ((*buf >> 4) & 7) { | 1293 | switch ((*buf >> 4) & 7) { |
1294 | case 1: | 1294 | case 1: |
1295 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); | 1295 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); |
1296 | cs_old = cset; | 1296 | cs_old = cset; |
1297 | cset = *buf & 7; | 1297 | cset = *buf & 7; |
1298 | cs_fest = *buf & 8; | 1298 | cs_fest = *buf & 8; |
1299 | break; | 1299 | break; |
1300 | case 3: | 1300 | case 3: |
1301 | dp += sprintf(dp, " Congestion level %x\n", *buf & 0xf); | 1301 | dp += sprintf(dp, " Congestion level %x\n", *buf & 0xf); |
1302 | break; | 1302 | break; |
1303 | case 2: | 1303 | case 2: |
1304 | if (*buf == 0xa0) { | 1304 | if (*buf == 0xa0) { |
1305 | dp += sprintf(dp, " More data\n"); | 1305 | dp += sprintf(dp, " More data\n"); |
1306 | break; | ||
1307 | } | ||
1308 | if (*buf == 0xa1) { | ||
1309 | dp += sprintf(dp, " Sending complete\n"); | ||
1310 | } | ||
1311 | break; | ||
1312 | /* fall through */ | ||
1313 | default: | ||
1314 | dp += sprintf(dp, " Reserved %x\n", *buf); | ||
1315 | break; | 1306 | break; |
1307 | } | ||
1308 | if (*buf == 0xa1) { | ||
1309 | dp += sprintf(dp, " Sending complete\n"); | ||
1310 | } | ||
1311 | break; | ||
1312 | /* fall through */ | ||
1313 | default: | ||
1314 | dp += sprintf(dp, " Reserved %x\n", *buf); | ||
1315 | break; | ||
1316 | } | 1316 | } |
1317 | buf++; | 1317 | buf++; |
1318 | continue; | 1318 | continue; |
@@ -1366,11 +1366,11 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1366 | /* display message type if it exists */ | 1366 | /* display message type if it exists */ |
1367 | if (i == MTSIZE) | 1367 | if (i == MTSIZE) |
1368 | dp += sprintf(dp, "callref %d %s size %d unknown message type %x!\n", | 1368 | dp += sprintf(dp, "callref %d %s size %d unknown message type %x!\n", |
1369 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", | 1369 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", |
1370 | size, mt); | 1370 | size, mt); |
1371 | else | 1371 | else |
1372 | dp += sprintf(dp, "callref %d %s size %d message type %s\n", | 1372 | dp += sprintf(dp, "callref %d %s size %d message type %s\n", |
1373 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", | 1373 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", |
1374 | size, mtlist[i].descr); | 1374 | size, mtlist[i].descr); |
1375 | 1375 | ||
1376 | /* display each information element */ | 1376 | /* display each information element */ |
@@ -1378,15 +1378,15 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1378 | /* Is it a single octet information element? */ | 1378 | /* Is it a single octet information element? */ |
1379 | if (*buf & 0x80) { | 1379 | if (*buf & 0x80) { |
1380 | switch ((*buf >> 4) & 7) { | 1380 | switch ((*buf >> 4) & 7) { |
1381 | case 1: | 1381 | case 1: |
1382 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); | 1382 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); |
1383 | cs_old = cset; | 1383 | cs_old = cset; |
1384 | cset = *buf & 7; | 1384 | cset = *buf & 7; |
1385 | cs_fest = *buf & 8; | 1385 | cs_fest = *buf & 8; |
1386 | break; | 1386 | break; |
1387 | default: | 1387 | default: |
1388 | dp += sprintf(dp, " Unknown single-octet IE %x\n", *buf); | 1388 | dp += sprintf(dp, " Unknown single-octet IE %x\n", *buf); |
1389 | break; | 1389 | break; |
1390 | } | 1390 | } |
1391 | buf++; | 1391 | buf++; |
1392 | continue; | 1392 | continue; |
@@ -1452,11 +1452,11 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1452 | /* display message type if it exists */ | 1452 | /* display message type if it exists */ |
1453 | if (i == MTSIZE) | 1453 | if (i == MTSIZE) |
1454 | dp += sprintf(dp, "callref %d %s size %d unknown message type %x!\n", | 1454 | dp += sprintf(dp, "callref %d %s size %d unknown message type %x!\n", |
1455 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", | 1455 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", |
1456 | size, mt); | 1456 | size, mt); |
1457 | else | 1457 | else |
1458 | dp += sprintf(dp, "callref %d %s size %d message type %s\n", | 1458 | dp += sprintf(dp, "callref %d %s size %d message type %s\n", |
1459 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", | 1459 | cr & 0x7f, (cr & 0x80) ? "called" : "caller", |
1460 | size, mtlist[i].descr); | 1460 | size, mtlist[i].descr); |
1461 | 1461 | ||
1462 | /* display each information element */ | 1462 | /* display each information element */ |
@@ -1464,28 +1464,28 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) | |||
1464 | /* Is it a single octet information element? */ | 1464 | /* Is it a single octet information element? */ |
1465 | if (*buf & 0x80) { | 1465 | if (*buf & 0x80) { |
1466 | switch ((*buf >> 4) & 7) { | 1466 | switch ((*buf >> 4) & 7) { |
1467 | case 1: | 1467 | case 1: |
1468 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); | 1468 | dp += sprintf(dp, " Shift %x\n", *buf & 0xf); |
1469 | break; | 1469 | break; |
1470 | case 3: | 1470 | case 3: |
1471 | dp += sprintf(dp, " Congestion level %x\n", *buf & 0xf); | 1471 | dp += sprintf(dp, " Congestion level %x\n", *buf & 0xf); |
1472 | break; | 1472 | break; |
1473 | case 5: | 1473 | case 5: |
1474 | dp += sprintf(dp, " Repeat indicator %x\n", *buf & 0xf); | 1474 | dp += sprintf(dp, " Repeat indicator %x\n", *buf & 0xf); |
1475 | break; | 1475 | break; |
1476 | case 2: | 1476 | case 2: |
1477 | if (*buf == 0xa0) { | 1477 | if (*buf == 0xa0) { |
1478 | dp += sprintf(dp, " More data\n"); | 1478 | dp += sprintf(dp, " More data\n"); |
1479 | break; | ||
1480 | } | ||
1481 | if (*buf == 0xa1) { | ||
1482 | dp += sprintf(dp, " Sending complete\n"); | ||
1483 | } | ||
1484 | break; | ||
1485 | /* fall through */ | ||
1486 | default: | ||
1487 | dp += sprintf(dp, " Reserved %x\n", *buf); | ||
1488 | break; | 1479 | break; |
1480 | } | ||
1481 | if (*buf == 0xa1) { | ||
1482 | dp += sprintf(dp, " Sending complete\n"); | ||
1483 | } | ||
1484 | break; | ||
1485 | /* fall through */ | ||
1486 | default: | ||
1487 | dp += sprintf(dp, " Reserved %x\n", *buf); | ||
1488 | break; | ||
1489 | } | 1489 | } |
1490 | buf++; | 1490 | buf++; |
1491 | continue; | 1491 | continue; |