diff options
author | Joe Perches <joe@perches.com> | 2013-05-04 23:12:25 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-05-04 23:17:23 -0400 |
commit | f96637be081141d6f8813429499f164260b49d70 (patch) | |
tree | c91f5a9b5a2b7a67bbeda15d7c9805655547a098 /fs/cifs/asn1.c | |
parent | f7f7c1850eb98da758731ea7edfa830ebefe24cd (diff) |
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros
are for debugging. Convert the names to a single more typical
kernel style cifs_dbg macro.
cERROR(1, ...) -> cifs_dbg(VFS, ...)
cFYI(1, ...) -> cifs_dbg(FYI, ...)
cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)
Move the terminating format newline from the macro to the call site.
Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.
Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)
$ size fs/cifs/cifs.ko*
text data bss dec hex filename
265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old
Other miscellaneous changes around these conversions:
o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
from the macros to be more kernel style like. A few formats
previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/asn1.c')
-rw-r--r-- | fs/cifs/asn1.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c index 1d36db114772..a3b56544c21b 100644 --- a/fs/cifs/asn1.c +++ b/fs/cifs/asn1.c | |||
@@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
506 | 506 | ||
507 | /* GSSAPI header */ | 507 | /* GSSAPI header */ |
508 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { | 508 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { |
509 | cFYI(1, "Error decoding negTokenInit header"); | 509 | cifs_dbg(FYI, "Error decoding negTokenInit header\n"); |
510 | return 0; | 510 | return 0; |
511 | } else if ((cls != ASN1_APL) || (con != ASN1_CON) | 511 | } else if ((cls != ASN1_APL) || (con != ASN1_CON) |
512 | || (tag != ASN1_EOC)) { | 512 | || (tag != ASN1_EOC)) { |
513 | cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag); | 513 | cifs_dbg(FYI, "cls = %d con = %d tag = %d\n", cls, con, tag); |
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
@@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
531 | 531 | ||
532 | /* SPNEGO OID not present or garbled -- bail out */ | 532 | /* SPNEGO OID not present or garbled -- bail out */ |
533 | if (!rc) { | 533 | if (!rc) { |
534 | cFYI(1, "Error decoding negTokenInit header"); | 534 | cifs_dbg(FYI, "Error decoding negTokenInit header\n"); |
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
537 | 537 | ||
538 | /* SPNEGO */ | 538 | /* SPNEGO */ |
539 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { | 539 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { |
540 | cFYI(1, "Error decoding negTokenInit"); | 540 | cifs_dbg(FYI, "Error decoding negTokenInit\n"); |
541 | return 0; | 541 | return 0; |
542 | } else if ((cls != ASN1_CTX) || (con != ASN1_CON) | 542 | } else if ((cls != ASN1_CTX) || (con != ASN1_CON) |
543 | || (tag != ASN1_EOC)) { | 543 | || (tag != ASN1_EOC)) { |
544 | cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", | 544 | cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n", |
545 | cls, con, tag, end, *end); | 545 | cls, con, tag, end, *end); |
546 | return 0; | 546 | return 0; |
547 | } | 547 | } |
548 | 548 | ||
549 | /* negTokenInit */ | 549 | /* negTokenInit */ |
550 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { | 550 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { |
551 | cFYI(1, "Error decoding negTokenInit"); | 551 | cifs_dbg(FYI, "Error decoding negTokenInit\n"); |
552 | return 0; | 552 | return 0; |
553 | } else if ((cls != ASN1_UNI) || (con != ASN1_CON) | 553 | } else if ((cls != ASN1_UNI) || (con != ASN1_CON) |
554 | || (tag != ASN1_SEQ)) { | 554 | || (tag != ASN1_SEQ)) { |
555 | cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", | 555 | cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n", |
556 | cls, con, tag, end, *end); | 556 | cls, con, tag, end, *end); |
557 | return 0; | 557 | return 0; |
558 | } | 558 | } |
559 | 559 | ||
560 | /* sequence */ | 560 | /* sequence */ |
561 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { | 561 | if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { |
562 | cFYI(1, "Error decoding 2nd part of negTokenInit"); | 562 | cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n"); |
563 | return 0; | 563 | return 0; |
564 | } else if ((cls != ASN1_CTX) || (con != ASN1_CON) | 564 | } else if ((cls != ASN1_CTX) || (con != ASN1_CON) |
565 | || (tag != ASN1_EOC)) { | 565 | || (tag != ASN1_EOC)) { |
566 | cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", | 566 | cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n", |
567 | cls, con, tag, end, *end); | 567 | cls, con, tag, end, *end); |
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | 570 | ||
571 | /* sequence of */ | 571 | /* sequence of */ |
572 | if (asn1_header_decode | 572 | if (asn1_header_decode |
573 | (&ctx, &sequence_end, &cls, &con, &tag) == 0) { | 573 | (&ctx, &sequence_end, &cls, &con, &tag) == 0) { |
574 | cFYI(1, "Error decoding 2nd part of negTokenInit"); | 574 | cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n"); |
575 | return 0; | 575 | return 0; |
576 | } else if ((cls != ASN1_UNI) || (con != ASN1_CON) | 576 | } else if ((cls != ASN1_UNI) || (con != ASN1_CON) |
577 | || (tag != ASN1_SEQ)) { | 577 | || (tag != ASN1_SEQ)) { |
578 | cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", | 578 | cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n", |
579 | cls, con, tag, end, *end); | 579 | cls, con, tag, end, *end); |
580 | return 0; | 580 | return 0; |
581 | } | 581 | } |
582 | 582 | ||
@@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
584 | while (!asn1_eoc_decode(&ctx, sequence_end)) { | 584 | while (!asn1_eoc_decode(&ctx, sequence_end)) { |
585 | rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); | 585 | rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); |
586 | if (!rc) { | 586 | if (!rc) { |
587 | cFYI(1, "Error decoding negTokenInit hdr exit2"); | 587 | cifs_dbg(FYI, "Error decoding negTokenInit hdr exit2\n"); |
588 | return 0; | 588 | return 0; |
589 | } | 589 | } |
590 | if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { | 590 | if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { |
591 | if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { | 591 | if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { |
592 | 592 | ||
593 | cFYI(1, "OID len = %d oid = 0x%lx 0x%lx " | 593 | cifs_dbg(FYI, "OID len = %d oid = 0x%lx 0x%lx 0x%lx 0x%lx\n", |
594 | "0x%lx 0x%lx", oidlen, *oid, | 594 | oidlen, *oid, *(oid + 1), *(oid + 2), |
595 | *(oid + 1), *(oid + 2), *(oid + 3)); | 595 | *(oid + 3)); |
596 | 596 | ||
597 | if (compare_oid(oid, oidlen, MSKRB5_OID, | 597 | if (compare_oid(oid, oidlen, MSKRB5_OID, |
598 | MSKRB5_OID_LEN)) | 598 | MSKRB5_OID_LEN)) |
@@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
610 | kfree(oid); | 610 | kfree(oid); |
611 | } | 611 | } |
612 | } else { | 612 | } else { |
613 | cFYI(1, "Should be an oid what is going on?"); | 613 | cifs_dbg(FYI, "Should be an oid what is going on?\n"); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | 616 | ||