diff options
author | Ed L. Cashin <ecashin@coraid.com> | 2006-09-20 14:36:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-18 15:53:50 -0400 |
commit | 6bb6285fdb948cedee586c6bebc9ebc5e32a5c35 (patch) | |
tree | 775bff808343ef52d1b254a9e33144f13a197a45 /drivers/block/aoe/aoecmd.c | |
parent | 19bf26353c50bc2be375109ec73f2f0bbd616ed1 (diff) |
aoe: clean up printks via macros
Use simple macros to clean up the printks.
(This patch is reverted by the 14th patch to follow.)
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 666797d646d6..63c456082d81 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -155,7 +155,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f) | |||
155 | buf->nframesout += 1; | 155 | buf->nframesout += 1; |
156 | buf->bufaddr += bcnt; | 156 | buf->bufaddr += bcnt; |
157 | buf->bv_resid -= bcnt; | 157 | buf->bv_resid -= bcnt; |
158 | /* printk(KERN_INFO "aoe: bv_resid=%ld\n", buf->bv_resid); */ | 158 | /* dprintk("bv_resid=%ld\n", buf->bv_resid); */ |
159 | buf->resid -= bcnt; | 159 | buf->resid -= bcnt; |
160 | buf->sector += bcnt >> 9; | 160 | buf->sector += bcnt >> 9; |
161 | if (buf->resid == 0) { | 161 | if (buf->resid == 0) { |
@@ -197,7 +197,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail) | |||
197 | 197 | ||
198 | skb = new_skb(sizeof *h + sizeof *ch); | 198 | skb = new_skb(sizeof *h + sizeof *ch); |
199 | if (skb == NULL) { | 199 | if (skb == NULL) { |
200 | printk(KERN_INFO "aoe: aoecmd_cfg: skb alloc failure\n"); | 200 | iprintk("skb alloc failure\n"); |
201 | continue; | 201 | continue; |
202 | } | 202 | } |
203 | skb->dev = ifp; | 203 | skb->dev = ifp; |
@@ -247,7 +247,7 @@ loop: | |||
247 | return; | 247 | return; |
248 | buf = container_of(d->bufq.next, struct buf, bufs); | 248 | buf = container_of(d->bufq.next, struct buf, bufs); |
249 | list_del(d->bufq.next); | 249 | list_del(d->bufq.next); |
250 | /*printk(KERN_INFO "aoecmd_work: bi_size=%ld\n", buf->bio->bi_size); */ | 250 | /*dprintk("bi_size=%ld\n", buf->bio->bi_size); */ |
251 | d->inprocess = buf; | 251 | d->inprocess = buf; |
252 | } | 252 | } |
253 | aoecmd_ata_rw(d, f); | 253 | aoecmd_ata_rw(d, f); |
@@ -287,8 +287,7 @@ rexmit(struct aoedev *d, struct frame *f) | |||
287 | offset_in_page(f->bufaddr), DEFAULTBCNT); | 287 | offset_in_page(f->bufaddr), DEFAULTBCNT); |
288 | if (++d->lostjumbo > (d->nframes << 1)) | 288 | if (++d->lostjumbo > (d->nframes << 1)) |
289 | if (d->maxbcnt != DEFAULTBCNT) { | 289 | if (d->maxbcnt != DEFAULTBCNT) { |
290 | printk(KERN_INFO "aoe: rexmit: too many lost jumbo. " | 290 | iprintk("too many lost jumbo - using 1KB frames.\n"); |
291 | "dropping back to 1KB frames.\n"); | ||
292 | d->maxbcnt = DEFAULTBCNT; | 291 | d->maxbcnt = DEFAULTBCNT; |
293 | d->flags |= DEVFL_MAXBCNT; | 292 | d->flags |= DEVFL_MAXBCNT; |
294 | } | 293 | } |
@@ -435,8 +434,8 @@ ataid_complete(struct aoedev *d, unsigned char *id) | |||
435 | } | 434 | } |
436 | 435 | ||
437 | if (d->ssize != ssize) | 436 | if (d->ssize != ssize) |
438 | printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu " | 437 | iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n", |
439 | "sectors\n", (unsigned long long)mac_addr(d->addr), | 438 | (unsigned long long)mac_addr(d->addr), |
440 | d->aoemajor, d->aoeminor, | 439 | d->aoemajor, d->aoeminor, |
441 | d->fw_ver, (long long)ssize); | 440 | d->fw_ver, (long long)ssize); |
442 | d->ssize = ssize; | 441 | d->ssize = ssize; |
@@ -446,11 +445,9 @@ ataid_complete(struct aoedev *d, unsigned char *id) | |||
446 | d->flags |= DEVFL_NEWSIZE; | 445 | d->flags |= DEVFL_NEWSIZE; |
447 | } else { | 446 | } else { |
448 | if (d->flags & DEVFL_GDALLOC) { | 447 | if (d->flags & DEVFL_GDALLOC) { |
449 | printk(KERN_INFO "aoe: %s: %s e%lu.%lu, %s\n", | 448 | eprintk("can't schedule work for e%lu.%lu, %s\n", |
450 | __FUNCTION__, | ||
451 | "can't schedule work for", | ||
452 | d->aoemajor, d->aoeminor, | 449 | d->aoemajor, d->aoeminor, |
453 | "it's already on! (This really shouldn't happen).\n"); | 450 | "it's already on! This shouldn't happen.\n"); |
454 | return; | 451 | return; |
455 | } | 452 | } |
456 | d->flags |= DEVFL_GDALLOC; | 453 | d->flags |= DEVFL_GDALLOC; |
@@ -524,8 +521,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
524 | if (ahout->cmdstat == WIN_IDENTIFY) | 521 | if (ahout->cmdstat == WIN_IDENTIFY) |
525 | d->flags &= ~DEVFL_PAUSE; | 522 | d->flags &= ~DEVFL_PAUSE; |
526 | if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ | 523 | if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ |
527 | printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh " | 524 | eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n", |
528 | "stat=%2.2Xh from e%ld.%ld\n", | ||
529 | ahout->cmdstat, ahin->cmdstat, | 525 | ahout->cmdstat, ahin->cmdstat, |
530 | d->aoemajor, d->aoeminor); | 526 | d->aoemajor, d->aoeminor); |
531 | if (buf) | 527 | if (buf) |
@@ -536,8 +532,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
536 | case WIN_READ: | 532 | case WIN_READ: |
537 | case WIN_READ_EXT: | 533 | case WIN_READ_EXT: |
538 | if (skb->len - sizeof *hin - sizeof *ahin < n) { | 534 | if (skb->len - sizeof *hin - sizeof *ahin < n) { |
539 | printk(KERN_CRIT "aoe: aoecmd_ata_rsp: runt " | 535 | eprintk("runt data size in read. skb->len=%d\n", |
540 | "ata data size in read. skb->len=%d\n", | ||
541 | skb->len); | 536 | skb->len); |
542 | /* fail frame f? just returning will rexmit. */ | 537 | /* fail frame f? just returning will rexmit. */ |
543 | spin_unlock_irqrestore(&d->lock, flags); | 538 | spin_unlock_irqrestore(&d->lock, flags); |
@@ -549,10 +544,13 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
549 | if (f->bcnt -= n) { | 544 | if (f->bcnt -= n) { |
550 | f->bufaddr += n; | 545 | f->bufaddr += n; |
551 | put_lba(ahout, f->lba += ahout->scnt); | 546 | put_lba(ahout, f->lba += ahout->scnt); |
552 | n = f->bcnt > DEFAULTBCNT ? DEFAULTBCNT : f->bcnt; | 547 | n = f->bcnt; |
548 | if (n > DEFAULTBCNT) | ||
549 | n = DEFAULTBCNT; | ||
553 | ahout->scnt = n >> 9; | 550 | ahout->scnt = n >> 9; |
554 | if (ahout->aflags & AOEAFL_WRITE) | 551 | if (ahout->aflags & AOEAFL_WRITE) |
555 | skb_fill_page_desc(f->skb, 0, virt_to_page(f->bufaddr), | 552 | skb_fill_page_desc(f->skb, 0, |
553 | virt_to_page(f->bufaddr), | ||
556 | offset_in_page(f->bufaddr), n); | 554 | offset_in_page(f->bufaddr), n); |
557 | skb_get(f->skb); | 555 | skb_get(f->skb); |
558 | f->skb->next = NULL; | 556 | f->skb->next = NULL; |
@@ -565,19 +563,18 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
565 | break; | 563 | break; |
566 | case WIN_IDENTIFY: | 564 | case WIN_IDENTIFY: |
567 | if (skb->len - sizeof *hin - sizeof *ahin < 512) { | 565 | if (skb->len - sizeof *hin - sizeof *ahin < 512) { |
568 | printk(KERN_INFO "aoe: aoecmd_ata_rsp: runt data size " | 566 | iprintk("runt data size in ataid. skb->len=%d\n", |
569 | "in ataid. skb->len=%d\n", skb->len); | 567 | skb->len); |
570 | spin_unlock_irqrestore(&d->lock, flags); | 568 | spin_unlock_irqrestore(&d->lock, flags); |
571 | return; | 569 | return; |
572 | } | 570 | } |
573 | ataid_complete(d, (char *) (ahin+1)); | 571 | ataid_complete(d, (char *) (ahin+1)); |
574 | break; | 572 | break; |
575 | default: | 573 | default: |
576 | printk(KERN_INFO "aoe: aoecmd_ata_rsp: unrecognized " | 574 | iprintk("unrecognized ata command %2.2Xh for %d.%d\n", |
577 | "outbound ata command %2.2Xh for %d.%d\n", | 575 | ahout->cmdstat, |
578 | ahout->cmdstat, | 576 | be16_to_cpu(hin->major), |
579 | be16_to_cpu(hin->major), | 577 | hin->minor); |
580 | hin->minor); | ||
581 | } | 578 | } |
582 | } | 579 | } |
583 | 580 | ||
@@ -634,8 +631,7 @@ aoecmd_ata_id(struct aoedev *d) | |||
634 | 631 | ||
635 | f = getframe(d, FREETAG); | 632 | f = getframe(d, FREETAG); |
636 | if (f == NULL) { | 633 | if (f == NULL) { |
637 | printk(KERN_CRIT "aoe: aoecmd_ata_id: can't get a frame. " | 634 | eprintk("can't get a frame. This shouldn't happen.\n"); |
638 | "This shouldn't happen.\n"); | ||
639 | return NULL; | 635 | return NULL; |
640 | } | 636 | } |
641 | 637 | ||
@@ -682,15 +678,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
682 | */ | 678 | */ |
683 | aoemajor = be16_to_cpu(h->major); | 679 | aoemajor = be16_to_cpu(h->major); |
684 | if (aoemajor == 0xfff) { | 680 | if (aoemajor == 0xfff) { |
685 | printk(KERN_CRIT "aoe: aoecmd_cfg_rsp: Warning: shelf " | 681 | eprintk("Warning: shelf address is all ones. " |
686 | "address is all ones. Check shelf dip switches\n"); | 682 | "Check shelf dip switches.\n"); |
687 | return; | 683 | return; |
688 | } | 684 | } |
689 | 685 | ||
690 | sysminor = SYSMINOR(aoemajor, h->minor); | 686 | sysminor = SYSMINOR(aoemajor, h->minor); |
691 | if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { | 687 | if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { |
692 | printk(KERN_INFO | 688 | iprintk("e%ld.%d: minor number too large\n", |
693 | "aoe: e%ld.%d: minor number too large\n", | ||
694 | aoemajor, (int) h->minor); | 689 | aoemajor, (int) h->minor); |
695 | return; | 690 | return; |
696 | } | 691 | } |
@@ -701,7 +696,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
701 | 696 | ||
702 | d = aoedev_by_sysminor_m(sysminor, n); | 697 | d = aoedev_by_sysminor_m(sysminor, n); |
703 | if (d == NULL) { | 698 | if (d == NULL) { |
704 | printk(KERN_INFO "aoe: aoecmd_cfg_rsp: device sysminor_m failure\n"); | 699 | iprintk("device sysminor_m failure\n"); |
705 | return; | 700 | return; |
706 | } | 701 | } |
707 | 702 | ||