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

aoe: revert printk macros

This patch addresses the concern that the aoe driver should
not introduce unecessary conventions that must be learned by
the reader. It reverts patch 6.

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>

authored by

Ed L. Cashin and committed by
Greg Kroah-Hartman
a12c93f0 086216db

+39 -37
-5
drivers/block/aoe/aoe.h
··· 10 10 #define AOE_PARTITIONS (16) 11 11 #endif 12 12 13 - #define xprintk(L, fmt, arg...) printk(L "aoe: " "%s: " fmt, __func__, ## arg) 14 - #define iprintk(fmt, arg...) xprintk(KERN_INFO, fmt, ## arg) 15 - #define eprintk(fmt, arg...) xprintk(KERN_ERR, fmt, ## arg) 16 - #define dprintk(fmt, arg...) xprintk(KERN_DEBUG, fmt, ## arg) 17 - 18 13 #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor)) 19 14 #define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF) 20 15 #define AOEMINOR(sysminor) ((sysminor) % NPERSHELF)
+6 -5
drivers/block/aoe/aoeblk.c
··· 131 131 d = bio->bi_bdev->bd_disk->private_data; 132 132 buf = mempool_alloc(d->bufpool, GFP_NOIO); 133 133 if (buf == NULL) { 134 - iprintk("buf allocation failure\n"); 134 + printk(KERN_INFO "aoe: buf allocation failure\n"); 135 135 bio_endio(bio, bio->bi_size, -ENOMEM); 136 136 return 0; 137 137 } ··· 149 149 spin_lock_irqsave(&d->lock, flags); 150 150 151 151 if ((d->flags & DEVFL_UP) == 0) { 152 - iprintk("device %ld.%ld is not up\n", d->aoemajor, d->aoeminor); 152 + printk(KERN_INFO "aoe: device %ld.%ld is not up\n", 153 + d->aoemajor, d->aoeminor); 153 154 spin_unlock_irqrestore(&d->lock, flags); 154 155 mempool_free(buf, d->bufpool); 155 156 bio_endio(bio, bio->bi_size, -ENXIO); ··· 175 174 struct aoedev *d = bdev->bd_disk->private_data; 176 175 177 176 if ((d->flags & DEVFL_UP) == 0) { 178 - eprintk("disk not up\n"); 177 + printk(KERN_ERR "aoe: disk not up\n"); 179 178 return -ENODEV; 180 179 } 181 180 ··· 202 201 203 202 gd = alloc_disk(AOE_PARTITIONS); 204 203 if (gd == NULL) { 205 - eprintk("cannot allocate disk structure for %ld.%ld\n", 204 + printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n", 206 205 d->aoemajor, d->aoeminor); 207 206 spin_lock_irqsave(&d->lock, flags); 208 207 d->flags &= ~DEVFL_GDALLOC; ··· 212 211 213 212 d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache); 214 213 if (d->bufpool == NULL) { 215 - eprintk("cannot allocate bufpool for %ld.%ld\n", 214 + printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n", 216 215 d->aoemajor, d->aoeminor); 217 216 put_disk(gd); 218 217 spin_lock_irqsave(&d->lock, flags);
+6 -5
drivers/block/aoe/aoechr.c
··· 55 55 interfaces(const char __user *str, size_t size) 56 56 { 57 57 if (set_aoe_iflist(str, size)) { 58 - eprintk("could not set interface list: too many interfaces\n"); 58 + printk(KERN_ERR 59 + "aoe: could not set interface list: too many interfaces\n"); 59 60 return -EINVAL; 60 61 } 61 62 return 0; ··· 79 78 /* should be e%d.%d format */ 80 79 n = sscanf(buf, "e%d.%d", &major, &minor); 81 80 if (n != 2) { 82 - eprintk("invalid device specification\n"); 81 + printk(KERN_ERR "aoe: invalid device specification\n"); 83 82 return -EINVAL; 84 83 } 85 84 d = aoedev_by_aoeaddr(major, minor); ··· 114 113 115 114 mp = kmalloc(n, GFP_ATOMIC); 116 115 if (mp == NULL) { 117 - eprintk("allocation failure, len=%ld\n", n); 116 + printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n); 118 117 goto bail; 119 118 } 120 119 ··· 139 138 140 139 switch ((unsigned long) filp->private_data) { 141 140 default: 142 - iprintk("can't write to that file.\n"); 141 + printk(KERN_INFO "aoe: can't write to that file.\n"); 143 142 break; 144 143 case MINOR_DISCOVER: 145 144 ret = discover(); ··· 248 247 249 248 n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops); 250 249 if (n < 0) { 251 - eprintk("can't register char device\n"); 250 + printk(KERN_ERR "aoe: can't register char device\n"); 252 251 return n; 253 252 } 254 253 sema_init(&emsgs_sema, 0);
+20 -15
drivers/block/aoe/aoecmd.c
··· 159 159 buf->nframesout += 1; 160 160 buf->bufaddr += bcnt; 161 161 buf->bv_resid -= bcnt; 162 - /* dprintk("bv_resid=%ld\n", buf->bv_resid); */ 162 + /* printk(KERN_DEBUG "aoe: bv_resid=%ld\n", buf->bv_resid); */ 163 163 buf->resid -= bcnt; 164 164 buf->sector += bcnt >> 9; 165 165 if (buf->resid == 0) { ··· 203 203 204 204 skb = new_skb(sizeof *h + sizeof *ch); 205 205 if (skb == NULL) { 206 - iprintk("skb alloc failure\n"); 206 + printk(KERN_INFO "aoe: skb alloc failure\n"); 207 207 continue; 208 208 } 209 209 skb->dev = ifp; ··· 276 276 return; 277 277 buf = container_of(d->bufq.next, struct buf, bufs); 278 278 list_del(d->bufq.next); 279 - /*dprintk("bi_size=%ld\n", buf->bio->bi_size); */ 279 + /*printk(KERN_DEBUG "aoe: bi_size=%ld\n", buf->bio->bi_size); */ 280 280 d->inprocess = buf; 281 281 } 282 282 aoecmd_ata_rw(d, f); ··· 319 319 } 320 320 if (++d->lostjumbo > (d->nframes << 1)) 321 321 if (d->maxbcnt != DEFAULTBCNT) { 322 - iprintk("e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n", 322 + printk(KERN_INFO "aoe: e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n", 323 323 d->aoemajor, d->aoeminor, d->ifp->name); 324 324 d->maxbcnt = DEFAULTBCNT; 325 325 d->flags |= DEVFL_MAXBCNT; ··· 472 472 } 473 473 474 474 if (d->ssize != ssize) 475 - iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n", 475 + printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n", 476 476 (unsigned long long)mac_addr(d->addr), 477 477 d->aoemajor, d->aoeminor, 478 478 d->fw_ver, (long long)ssize); ··· 483 483 d->flags |= DEVFL_NEWSIZE; 484 484 } else { 485 485 if (d->flags & DEVFL_GDALLOC) { 486 - eprintk("can't schedule work for e%lu.%lu, %s\n", 486 + printk(KERN_ERR "aoe: can't schedule work for e%lu.%lu, %s\n", 487 487 d->aoemajor, d->aoeminor, 488 488 "it's already on! This shouldn't happen.\n"); 489 489 return; ··· 569 569 if (ahout->cmdstat == WIN_IDENTIFY) 570 570 d->flags &= ~DEVFL_PAUSE; 571 571 if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ 572 - eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n", 572 + printk(KERN_ERR 573 + "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n", 573 574 ahout->cmdstat, ahin->cmdstat, 574 575 d->aoemajor, d->aoeminor); 575 576 if (buf) ··· 581 580 case WIN_READ: 582 581 case WIN_READ_EXT: 583 582 if (skb->len - sizeof *hin - sizeof *ahin < n) { 584 - eprintk("runt data size in read. skb->len=%d\n", 583 + printk(KERN_ERR 584 + "aoe: runt data size in read. skb->len=%d\n", 585 585 skb->len); 586 586 /* fail frame f? just returning will rexmit. */ 587 587 spin_unlock_irqrestore(&d->lock, flags); ··· 620 618 break; 621 619 case WIN_IDENTIFY: 622 620 if (skb->len - sizeof *hin - sizeof *ahin < 512) { 623 - iprintk("runt data size in ataid. skb->len=%d\n", 621 + printk(KERN_INFO 622 + "aoe: runt data size in ataid. skb->len=%d\n", 624 623 skb->len); 625 624 spin_unlock_irqrestore(&d->lock, flags); 626 625 return; ··· 629 626 ataid_complete(d, (char *) (ahin+1)); 630 627 break; 631 628 default: 632 - iprintk("unrecognized ata command %2.2Xh for %d.%d\n", 629 + printk(KERN_INFO 630 + "aoe: unrecognized ata command %2.2Xh for %d.%d\n", 633 631 ahout->cmdstat, 634 632 be16_to_cpu(hin->major), 635 633 hin->minor); ··· 690 686 691 687 f = freeframe(d); 692 688 if (f == NULL) { 693 - eprintk("can't get a frame. This shouldn't happen.\n"); 689 + printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n"); 694 690 return NULL; 695 691 } 696 692 ··· 736 732 */ 737 733 aoemajor = be16_to_cpu(h->major); 738 734 if (aoemajor == 0xfff) { 739 - eprintk("Warning: shelf address is all ones. " 735 + printk(KERN_ERR "aoe: Warning: shelf address is all ones. " 740 736 "Check shelf dip switches.\n"); 741 737 return; 742 738 } 743 739 744 740 sysminor = SYSMINOR(aoemajor, h->minor); 745 741 if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { 746 - iprintk("e%ld.%d: minor number too large\n", 742 + printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n", 747 743 aoemajor, (int) h->minor); 748 744 return; 749 745 } ··· 754 750 755 751 d = aoedev_by_sysminor_m(sysminor, n); 756 752 if (d == NULL) { 757 - iprintk("device sysminor_m failure\n"); 753 + printk(KERN_INFO "aoe: device sysminor_m failure\n"); 758 754 return; 759 755 } 760 756 ··· 771 767 n = ch->scnt; 772 768 n = n ? n * 512 : DEFAULTBCNT; 773 769 if (n != d->maxbcnt) { 774 - iprintk("e%ld.%ld: setting %d byte data frames on %s\n", 770 + printk(KERN_INFO 771 + "aoe: e%ld.%ld: setting %d byte data frames on %s\n", 775 772 d->aoemajor, d->aoeminor, n, d->ifp->name); 776 773 d->maxbcnt = n; 777 774 }
+1 -1
drivers/block/aoe/aoedev.c
··· 156 156 d = aoedev_newdev(bufcnt); 157 157 if (d == NULL) { 158 158 spin_unlock_irqrestore(&devlist_lock, flags); 159 - iprintk("aoedev_newdev failure.\n"); 159 + printk(KERN_INFO "aoe: aoedev_newdev failure.\n"); 160 160 return NULL; 161 161 } 162 162 d->sysminor = sysminor;
+3 -3
drivers/block/aoe/aoemain.c
··· 84 84 goto net_fail; 85 85 ret = register_blkdev(AOE_MAJOR, DEVICE_NAME); 86 86 if (ret < 0) { 87 - eprintk("can't register major\n"); 87 + printk(KERN_ERR "aoe: can't register major\n"); 88 88 goto blkreg_fail; 89 89 } 90 90 91 - iprintk("AoE v%s initialised.\n", VERSION); 91 + printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION); 92 92 discover_timer(TINIT); 93 93 return 0; 94 94 ··· 101 101 chr_fail: 102 102 aoedev_exit(); 103 103 104 - iprintk("initialisation failure.\n"); 104 + printk(KERN_INFO "aoe: initialisation failure.\n"); 105 105 return ret; 106 106 } 107 107
+3 -3
drivers/block/aoe/aoenet.c
··· 74 74 return -EINVAL; 75 75 76 76 if (copy_from_user(aoe_iflist, user_str, size)) { 77 - iprintk("copy from user failed\n"); 77 + printk(KERN_INFO "aoe: copy from user failed\n"); 78 78 return -EFAULT; 79 79 } 80 80 aoe_iflist[size] = 0x00; ··· 132 132 if (n > NECODES) 133 133 n = 0; 134 134 if (net_ratelimit()) 135 - eprintk("error packet from %d.%d; ecode=%d '%s'\n", 135 + printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n", 136 136 be16_to_cpu(h->major), h->minor, 137 137 h->err, aoe_errlist[n]); 138 138 goto exit; ··· 146 146 aoecmd_cfg_rsp(skb); 147 147 break; 148 148 default: 149 - iprintk("unknown cmd %d\n", h->cmd); 149 + printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd); 150 150 } 151 151 exit: 152 152 dev_kfree_skb(skb);