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

[PATCH] I2O: Lindent run and replacement of printk through osm printing functions

Lindent run and replaced printk() through the corresponding osm_*() function

Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Markus Lidel and committed by
Linus Torvalds
f33213ec 9e87545f

+100 -110
+5 -5
drivers/message/i2o/Kconfig
··· 44 44 45 45 config I2O_CONFIG 46 46 tristate "I2O Configuration support" 47 - depends on PCI && I2O 48 - help 47 + depends on I2O 48 + ---help--- 49 49 Say Y for support of the configuration interface for the I2O adapters. 50 50 If you have a RAID controller from Adaptec and you want to use the 51 51 raidutils to manage your RAID array, you have to say Y here. ··· 74 74 config I2O_BLOCK 75 75 tristate "I2O Block OSM" 76 76 depends on I2O 77 - help 77 + ---help--- 78 78 Include support for the I2O Block OSM. The Block OSM presents disk 79 79 and other structured block devices to the operating system. If you 80 80 are using an RAID controller, you could access the array only by ··· 87 87 config I2O_SCSI 88 88 tristate "I2O SCSI OSM" 89 89 depends on I2O && SCSI 90 - help 90 + ---help--- 91 91 Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel 92 92 I2O controller. You can use both the SCSI and Block OSM together if 93 93 you wish. To access a RAID array, you must use the Block OSM driver. ··· 99 99 config I2O_PROC 100 100 tristate "I2O /proc support" 101 101 depends on I2O 102 - help 102 + ---help--- 103 103 If you say Y here and to "/proc file system support", you will be 104 104 able to read I2O related information from the virtual directory 105 105 /proc/i2o.
-1
drivers/message/i2o/device.c
··· 443 443 * Note that the minimum sized reslist is 8 bytes and contains 444 444 * ResultCount, ErrorInfoSize, BlockStatus and BlockSize. 445 445 */ 446 - 447 446 static int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, 448 447 int oplen, void *reslist, int reslen) 449 448 {
+1 -2
drivers/message/i2o/driver.c
··· 117 117 118 118 i2o_driver_notify_controller_add(drv, c); 119 119 list_for_each_entry(i2o_dev, &c->devices, list) 120 - i2o_driver_notify_device_add(drv, i2o_dev); 120 + i2o_driver_notify_device_add(drv, i2o_dev); 121 121 } 122 - 123 122 124 123 rc = driver_register(&drv->driver); 125 124 if (rc)
+1 -1
drivers/message/i2o/exec-osm.c
··· 152 152 list_add(&wait->list, &i2o_exec_wait_list); 153 153 154 154 wait_event_interruptible_timeout(wq, wait->complete, 155 - timeout * HZ); 155 + timeout * HZ); 156 156 157 157 wait->wq = NULL; 158 158 }
+1 -2
drivers/message/i2o/i2o_block.c
··· 940 940 INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, 941 941 dreq); 942 942 943 - osm_info("transfer error\n"); 944 943 if (!queue_delayed_work(i2o_block_driver.event_queue, 945 944 &dreq->work, 946 945 I2O_BLOCK_RETRY_TIME)) ··· 1041 1042 static int i2o_block_probe(struct device *dev) 1042 1043 { 1043 1044 struct i2o_device *i2o_dev = to_i2o_device(dev); 1044 - struct i2o_block_device *i2o_blk_dev; 1045 1045 struct i2o_controller *c = i2o_dev->iop; 1046 + struct i2o_block_device *i2o_blk_dev; 1046 1047 struct gendisk *gd; 1047 1048 struct request_queue *queue; 1048 1049 static int unit = 0;
+13 -15
drivers/message/i2o/i2o_block.h
··· 64 64 65 65 /* I2O Block OSM mempool struct */ 66 66 struct i2o_block_mempool { 67 - kmem_cache_t *slab; 68 - mempool_t *pool; 67 + kmem_cache_t *slab; 68 + mempool_t *pool; 69 69 }; 70 70 71 71 /* I2O Block device descriptor */ 72 72 struct i2o_block_device { 73 73 struct i2o_device *i2o_dev; /* pointer to I2O device */ 74 74 struct gendisk *gd; 75 - spinlock_t lock; /* queue lock */ 75 + spinlock_t lock; /* queue lock */ 76 76 struct list_head open_queue; /* list of transfered, but unfinished 77 77 requests */ 78 78 unsigned int open_queue_depth; /* number of requests in the queue */ 79 79 80 - int rcache; /* read cache flags */ 81 - int wcache; /* write cache flags */ 80 + int rcache; /* read cache flags */ 81 + int wcache; /* write cache flags */ 82 82 int flags; 83 - u16 power; /* power state */ 84 - int media_change_flag; /* media changed flag */ 83 + u16 power; /* power state */ 84 + int media_change_flag; /* media changed flag */ 85 85 }; 86 86 87 87 /* I2O Block device request */ 88 - struct i2o_block_request 89 - { 88 + struct i2o_block_request { 90 89 struct list_head queue; 91 - struct request *req; /* corresponding request */ 90 + struct request *req; /* corresponding request */ 92 91 struct i2o_block_device *i2o_blk_dev; /* I2O block device */ 93 - struct device *dev; /* device used for DMA */ 94 - int sg_nents; /* number of SG elements */ 95 - struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ 92 + struct device *dev; /* device used for DMA */ 93 + int sg_nents; /* number of SG elements */ 94 + struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ 96 95 }; 97 96 98 97 /* I2O Block device delayed request */ 99 - struct i2o_block_delayed_request 100 - { 98 + struct i2o_block_delayed_request { 101 99 struct work_struct work; 102 100 struct request_queue *queue; 103 101 };
+12 -8
drivers/message/i2o/i2o_config.c
··· 368 368 369 369 i2o_dma_free(&c->pdev->dev, &buffer); 370 370 371 - return_ret: 371 + return_ret: 372 372 return ret; 373 - return_fault: 373 + return_fault: 374 374 ret = -EFAULT; 375 375 goto return_ret; 376 376 }; ··· 519 519 520 520 #ifdef CONFIG_I2O_EXT_ADAPTEC 521 521 #ifdef CONFIG_COMPAT 522 - static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) 522 + static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, 523 + unsigned long arg) 523 524 { 524 525 struct i2o_cmd_passthru32 __user *cmd; 525 526 struct i2o_controller *c; ··· 647 646 flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { 648 647 // TODO 64bit fix 649 648 if (copy_from_user 650 - (p->virt, (void __user *)(unsigned long)sg[i].addr_bus, 651 - sg_size)) { 649 + (p->virt, 650 + (void __user *)(unsigned long)sg[i]. 651 + addr_bus, sg_size)) { 652 652 printk(KERN_DEBUG 653 653 "%s: Could not copy SG buf %d FROM user\n", 654 654 c->name, i); ··· 740 738 return rcode; 741 739 } 742 740 743 - static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) 741 + static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, 742 + unsigned long arg) 744 743 { 745 744 int ret; 746 - lock_kernel(); 747 - switch (cmd) { 745 + lock_kernel(); 746 + switch (cmd) { 748 747 case I2OGETIOPS: 749 748 ret = i2o_cfg_ioctl(NULL, file, cmd, arg); 750 749 break; ··· 1139 1136 osm_err("can't register device.\n"); 1140 1137 return -EBUSY; 1141 1138 } 1139 + 1142 1140 return 0; 1143 1141 } 1144 1142
+1 -1
drivers/message/i2o/i2o_proc.c
··· 28 28 */ 29 29 30 30 #define OSM_NAME "proc-osm" 31 - #define OSM_VERSION "$Rev$" 31 + #define OSM_VERSION "1.145" 32 32 #define OSM_DESCRIPTION "I2O ProcFS OSM" 33 33 34 34 #define I2O_MAX_MODULES 4
+58 -70
drivers/message/i2o/iop.c
··· 117 117 unsigned long flags; 118 118 119 119 if (!ptr) 120 - printk(KERN_ERR "%s: couldn't add NULL pointer to context list!" 121 - "\n", c->name); 120 + osm_err("%s: couldn't add NULL pointer to context list!\n", 121 + c->name); 122 122 123 123 entry = kmalloc(sizeof(*entry), GFP_ATOMIC); 124 124 if (!entry) { 125 - printk(KERN_ERR "%s: Could not allocate memory for context " 126 - "list element\n", c->name); 125 + osm_err("%s: Could not allocate memory for context list element" 126 + "\n", c->name); 127 127 return 0; 128 128 } 129 129 ··· 142 142 143 143 spin_unlock_irqrestore(&c->context_list_lock, flags); 144 144 145 - pr_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); 145 + osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); 146 146 147 147 return entry->context; 148 148 }; ··· 174 174 spin_unlock_irqrestore(&c->context_list_lock, flags); 175 175 176 176 if (!context) 177 - printk(KERN_WARNING "%s: Could not remove nonexistent ptr " 178 - "%p\n", c->name, ptr); 177 + osm_warn("%s: Could not remove nonexistent ptr %p\n", c->name, 178 + ptr); 179 179 180 - pr_debug("%s: remove ptr from context list %d -> %p\n", c->name, 181 - context, ptr); 180 + osm_debug("%s: remove ptr from context list %d -> %p\n", c->name, 181 + context, ptr); 182 182 183 183 return context; 184 184 }; ··· 208 208 spin_unlock_irqrestore(&c->context_list_lock, flags); 209 209 210 210 if (!ptr) 211 - printk(KERN_WARNING "%s: context id %d not found\n", c->name, 212 - context); 211 + osm_warn("%s: context id %d not found\n", c->name, context); 213 212 214 - pr_debug("%s: get ptr from context list %d -> %p\n", c->name, context, 215 - ptr); 213 + osm_debug("%s: get ptr from context list %d -> %p\n", c->name, context, 214 + ptr); 216 215 217 216 return ptr; 218 217 }; ··· 239 240 spin_unlock_irqrestore(&c->context_list_lock, flags); 240 241 241 242 if (!context) 242 - printk(KERN_WARNING "%s: Could not find nonexistent ptr " 243 - "%p\n", c->name, ptr); 243 + osm_warn("%s: Could not find nonexistent ptr %p\n", c->name, 244 + ptr); 244 245 245 - pr_debug("%s: get context id from context list %p -> %d\n", c->name, 246 - ptr, context); 246 + osm_debug("%s: get context id from context list %p -> %d\n", c->name, 247 + ptr, context); 247 248 248 249 return context; 249 250 }; ··· 323 324 324 325 /* Long timeout needed for quiesce if lots of devices */ 325 326 if ((rc = i2o_msg_post_wait(c, m, 240))) 326 - printk(KERN_INFO "%s: Unable to quiesce (status=%#x).\n", 327 - c->name, -rc); 327 + osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc); 328 328 else 329 - pr_debug("%s: Quiesced.\n", c->name); 329 + osm_debug("%s: Quiesced.\n", c->name); 330 330 331 331 i2o_status_get(c); // Entered READY state 332 332 ··· 363 365 364 366 /* How long of a timeout do we need? */ 365 367 if ((rc = i2o_msg_post_wait(c, m, 240))) 366 - printk(KERN_ERR "%s: Could not enable (status=%#x).\n", 367 - c->name, -rc); 368 + osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc); 368 369 else 369 - pr_debug("%s: Enabled.\n", c->name); 370 + osm_debug("%s: Enabled.\n", c->name); 370 371 371 372 i2o_status_get(c); // entered OPERATIONAL state 372 373 ··· 429 432 &msg->u.head[1]); 430 433 431 434 if ((rc = i2o_msg_post_wait(c, m, 30))) 432 - printk(KERN_INFO "%s: Unable to clear (status=%#x).\n", 433 - c->name, -rc); 435 + osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc); 434 436 else 435 - pr_debug("%s: Cleared.\n", c->name); 437 + osm_debug("%s: Cleared.\n", c->name); 436 438 437 439 /* Enable all IOPs */ 438 440 i2o_iop_enable_all(); ··· 566 570 * can't read one in the given ammount of time, we assume the 567 571 * IOP could not reboot properly. 568 572 */ 569 - pr_debug("%s: Reset in progress, waiting for reboot...\n", 570 - c->name); 573 + osm_debug("%s: Reset in progress, waiting for reboot...\n", 574 + c->name); 571 575 572 576 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); 573 577 while (m == I2O_QUEUE_EMPTY) { 574 578 if (time_after(jiffies, timeout)) { 575 - printk(KERN_ERR "%s: IOP reset timeout.\n", 576 - c->name); 579 + osm_err("%s: IOP reset timeout.\n", c->name); 577 580 rc = -ETIMEDOUT; 578 581 goto exit; 579 582 } ··· 630 635 631 636 rc = i2o_status_get(c); 632 637 if (rc) { 633 - printk(KERN_INFO "%s: Unable to obtain status, " 634 - "attempting a reset.\n", c->name); 638 + osm_info("%s: Unable to obtain status, attempting a reset.\n", 639 + c->name); 635 640 rc = i2o_iop_reset(c); 636 641 if (rc) 637 642 return rc; 638 643 } 639 644 640 645 if (sb->i2o_version > I2OVER15) { 641 - printk(KERN_ERR "%s: Not running version 1.5 of the I2O " 642 - "Specification.\n", c->name); 646 + osm_err("%s: Not running version 1.5 of the I2O Specification." 647 + "\n", c->name); 643 648 return -ENODEV; 644 649 } 645 650 646 651 switch (sb->iop_state) { 647 652 case ADAPTER_STATE_FAULTED: 648 - printk(KERN_CRIT "%s: hardware fault\n", c->name); 653 + osm_err("%s: hardware fault\n", c->name); 649 654 return -EFAULT; 650 655 651 656 case ADAPTER_STATE_READY: 652 657 case ADAPTER_STATE_OPERATIONAL: 653 658 case ADAPTER_STATE_HOLD: 654 659 case ADAPTER_STATE_FAILED: 655 - pr_debug("%s: already running, trying to reset...\n", c->name); 660 + osm_debug("%s: already running, trying to reset...\n", c->name); 656 661 rc = i2o_iop_reset(c); 657 662 if (rc) 658 663 return rc; ··· 702 707 res->flags = IORESOURCE_MEM; 703 708 res->start = 0; 704 709 res->end = 0; 705 - printk(KERN_INFO "%s: requires private memory resources.\n", 706 - c->name); 710 + osm_info("%s: requires private memory resources.\n", c->name); 707 711 root = pci_find_parent_resource(c->pdev, res); 708 712 if (root == NULL) 709 - printk(KERN_WARNING "%s: Can't find parent resource!\n", 710 - c->name); 713 + osm_warn("%s: Can't find parent resource!\n", c->name); 711 714 if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ 712 715 NULL, NULL) >= 0) { 713 716 c->mem_alloc = 1; 714 717 sb->current_mem_size = 1 + res->end - res->start; 715 718 sb->current_mem_base = res->start; 716 - printk(KERN_INFO "%s: allocated %ld bytes of PCI memory" 717 - " at 0x%08lX.\n", c->name, 718 - 1 + res->end - res->start, res->start); 719 + osm_info("%s: allocated %ld bytes of PCI memory at " 720 + "0x%08lX.\n", c->name, 721 + 1 + res->end - res->start, res->start); 719 722 } 720 723 } 721 724 ··· 723 730 res->flags = IORESOURCE_IO; 724 731 res->start = 0; 725 732 res->end = 0; 726 - printk(KERN_INFO "%s: requires private memory resources.\n", 727 - c->name); 733 + osm_info("%s: requires private memory resources.\n", c->name); 728 734 root = pci_find_parent_resource(c->pdev, res); 729 735 if (root == NULL) 730 - printk(KERN_WARNING "%s: Can't find parent resource!\n", 731 - c->name); 736 + osm_warn("%s: Can't find parent resource!\n", c->name); 732 737 if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ 733 738 NULL, NULL) >= 0) { 734 739 c->io_alloc = 1; 735 740 sb->current_io_size = 1 + res->end - res->start; 736 741 sb->current_mem_base = res->start; 737 - printk(KERN_INFO "%s: allocated %ld bytes of PCI I/O at" 738 - " 0x%08lX.\n", c->name, 739 - 1 + res->end - res->start, res->start); 742 + osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX" 743 + ".\n", c->name, 1 + res->end - res->start, 744 + res->start); 740 745 } 741 746 } 742 747 ··· 778 787 PCI_DMA_TODEVICE); 779 788 780 789 if (rc < 0) 781 - printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", 782 - c->name, -rc); 790 + osm_err("%s: Unable to set SysTab (status=%#x).\n", c->name, 791 + -rc); 783 792 else 784 - pr_debug("%s: SysTab set.\n", c->name); 793 + osm_debug("%s: SysTab set.\n", c->name); 785 794 786 795 i2o_status_get(c); // Entered READY state 787 796 ··· 805 814 return rc; 806 815 807 816 /* In READY state */ 808 - pr_debug("%s: Attempting to enable...\n", c->name); 817 + osm_debug("%s: Attempting to enable...\n", c->name); 809 818 rc = i2o_iop_enable(c); 810 819 if (rc) 811 820 return rc; ··· 824 833 { 825 834 struct i2o_device *dev, *tmp; 826 835 827 - pr_debug("%s: deleting controller\n", c->name); 836 + osm_debug("%s: deleting controller\n", c->name); 828 837 829 838 i2o_driver_notify_controller_remove_all(c); 830 839 ··· 873 882 874 883 systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); 875 884 if (!systab) { 876 - printk(KERN_ERR "i2o: unable to allocate memory for System " 877 - "Table\n"); 885 + osm_err("unable to allocate memory for System Table\n"); 878 886 return -ENOMEM; 879 887 } 880 888 memset(systab, 0, i2o_systab.len); ··· 885 895 i2o_status_block *sb; 886 896 887 897 if (count >= num_controllers) { 888 - printk(KERN_ERR "i2o: controller added while building " 889 - "system table\n"); 898 + osm_err("controller added while building system table" 899 + "\n"); 890 900 break; 891 901 } 892 902 ··· 900 910 * it is techninically not part of the I2O subsystem... 901 911 */ 902 912 if (unlikely(i2o_status_get(c))) { 903 - printk(KERN_ERR "%s: Deleting b/c could not get status" 904 - " while attempting to build system table\n", 905 - c->name); 913 + osm_err("%s: Deleting b/c could not get status while " 914 + "attempting to build system table\n", c->name); 906 915 i2o_iop_remove(c); 907 916 continue; // try the next one 908 917 } ··· 983 994 timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; 984 995 while (status_block[87] != 0xFF) { 985 996 if (time_after(jiffies, timeout)) { 986 - printk(KERN_ERR "%s: Get status timeout.\n", c->name); 997 + osm_err("%s: Get status timeout.\n", c->name); 987 998 return -ETIMEDOUT; 988 999 } 989 1000 ··· 1032 1043 rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); 1033 1044 1034 1045 if (rc < 0) { 1035 - printk(KERN_ERR "%s: Unable to get HRT (status=%#x)\n", 1036 - c->name, -rc); 1046 + osm_err("%s: Unable to get HRT (status=%#x)\n", c->name, 1047 + -rc); 1037 1048 return rc; 1038 1049 } 1039 1050 ··· 1047 1058 return i2o_parse_hrt(c); 1048 1059 } 1049 1060 1050 - printk(KERN_ERR "%s: Unable to get HRT after %d tries, giving up\n", 1051 - c->name, I2O_HRT_GET_TRIES); 1061 + osm_err("%s: Unable to get HRT after %d tries, giving up\n", c->name, 1062 + I2O_HRT_GET_TRIES); 1052 1063 1053 1064 return -EBUSY; 1054 1065 } ··· 1061 1072 { 1062 1073 kfree(c); 1063 1074 }; 1064 - 1065 1075 1066 1076 /** 1067 1077 * i2o_iop_release - release the memory for a I2O controller ··· 1097 1109 1098 1110 c = kmalloc(sizeof(*c), GFP_KERNEL); 1099 1111 if (!c) { 1100 - printk(KERN_ERR "i2o: Insufficient memory to allocate a I2O " 1101 - "controller.\n"); 1112 + osm_err("i2o: Insufficient memory to allocate a I2O controller." 1113 + "\n"); 1102 1114 return ERR_PTR(-ENOMEM); 1103 1115 } 1104 1116 memset(c, 0, sizeof(*c));
+4 -1
drivers/message/i2o/pci.c
··· 179 179 return -ENOMEM; 180 180 } 181 181 182 - if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) { 182 + if (i2o_dma_alloc 183 + (dev, &c->out_queue, 184 + I2O_MAX_OUTBOUND_MSG_FRAMES * I2O_OUTBOUND_MSG_FRAME_SIZE * 185 + sizeof(u32), GFP_KERNEL)) { 183 186 i2o_pci_free(c); 184 187 return -ENOMEM; 185 188 }
+4 -4
include/linux/i2o.h
··· 156 156 157 157 struct pci_dev *pdev; /* PCI device */ 158 158 159 - unsigned int promise:1; /* Promise controller */ 160 - unsigned int adaptec:1; /* DPT / Adaptec controller */ 159 + unsigned int promise:1; /* Promise controller */ 160 + unsigned int adaptec:1; /* DPT / Adaptec controller */ 161 161 unsigned int raptor:1; /* split bar */ 162 162 unsigned int no_quiesce:1; /* dont quiesce before reset */ 163 163 unsigned int short_req:1; /* use small block sizes */ ··· 174 174 175 175 /* Dynamic LCT related data */ 176 176 177 - struct i2o_dma status; /* status of IOP */ 177 + struct i2o_dma status; /* IOP status block */ 178 178 179 179 struct i2o_dma hrt; /* HW Resource Table */ 180 180 i2o_lct *lct; /* Logical Config Table */ ··· 186 186 struct i2o_io in_queue; /* inbound message queue Host->IOP */ 187 187 struct i2o_dma out_queue; /* outbound message queue IOP->Host */ 188 188 189 - unsigned int battery:1; /* Has a battery backup */ 189 + unsigned int battery:1; /* Has a battery backup */ 190 190 unsigned int io_alloc:1; /* An I/O resource was allocated */ 191 191 unsigned int mem_alloc:1; /* A memory resource was allocated */ 192 192