diff options
author | Markus Lidel <Markus.Lidel@shadowconnect.com> | 2005-06-23 22:02:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 00:05:29 -0700 |
commit | f33213ecf49c98da4e85121b592c3bea8057c2e6 (patch) | |
tree | da7e51e7204625f21371eac23a931f4fe479e9db /drivers/message | |
parent | 9e87545f06930c1d294423a8091d1077e7444a47 (diff) | |
download | linux-f33213ecf49c98da4e85121b592c3bea8057c2e6.tar.bz2 |
[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>
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/i2o/Kconfig | 10 | ||||
-rw-r--r-- | drivers/message/i2o/device.c | 1 | ||||
-rw-r--r-- | drivers/message/i2o/driver.c | 3 | ||||
-rw-r--r-- | drivers/message/i2o/exec-osm.c | 2 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_block.c | 3 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_block.h | 28 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 20 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_proc.c | 2 | ||||
-rw-r--r-- | drivers/message/i2o/iop.c | 128 | ||||
-rw-r--r-- | drivers/message/i2o/pci.c | 5 |
10 files changed, 96 insertions, 106 deletions
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 94b6d676c5cb..06e8eb19a05c 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig @@ -44,8 +44,8 @@ config I2O_EXT_ADAPTEC_DMA64 config I2O_CONFIG tristate "I2O Configuration support" - depends on PCI && I2O - help + depends on I2O + ---help--- Say Y for support of the configuration interface for the I2O adapters. If you have a RAID controller from Adaptec and you want to use the raidutils to manage your RAID array, you have to say Y here. @@ -74,7 +74,7 @@ config I2O_BUS config I2O_BLOCK tristate "I2O Block OSM" depends on I2O - help + ---help--- Include support for the I2O Block OSM. The Block OSM presents disk and other structured block devices to the operating system. If you are using an RAID controller, you could access the array only by @@ -87,7 +87,7 @@ config I2O_BLOCK config I2O_SCSI tristate "I2O SCSI OSM" depends on I2O && SCSI - help + ---help--- Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel I2O controller. You can use both the SCSI and Block OSM together if you wish. To access a RAID array, you must use the Block OSM driver. @@ -99,7 +99,7 @@ config I2O_SCSI config I2O_PROC tristate "I2O /proc support" depends on I2O - help + ---help--- If you say Y here and to "/proc file system support", you will be able to read I2O related information from the virtual directory /proc/i2o. diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 0ee342ea29bc..d8d6e89a91cc 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -443,7 +443,6 @@ static struct class_interface i2o_device_class_interface = { * Note that the minimum sized reslist is 8 bytes and contains * ResultCount, ErrorInfoSize, BlockStatus and BlockSize. */ - static int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, int oplen, void *reslist, int reslen) { diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index c32f9dbc5744..739bfdef0c6d 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c @@ -117,10 +117,9 @@ int i2o_driver_register(struct i2o_driver *drv) i2o_driver_notify_controller_add(drv, c); list_for_each_entry(i2o_dev, &c->devices, list) - i2o_driver_notify_device_add(drv, i2o_dev); + i2o_driver_notify_device_add(drv, i2o_dev); } - rc = driver_register(&drv->driver); if (rc) destroy_workqueue(drv->event_queue); diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index ffe0cecfa060..1b7389876e70 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c @@ -152,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long list_add(&wait->list, &i2o_exec_wait_list); wait_event_interruptible_timeout(wq, wait->complete, - timeout * HZ); + timeout * HZ); wait->wq = NULL; } diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 28b3918dbc16..f283b5bafdd3 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -940,7 +940,6 @@ static void i2o_block_request_fn(struct request_queue *q) INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, dreq); - osm_info("transfer error\n"); if (!queue_delayed_work(i2o_block_driver.event_queue, &dreq->work, I2O_BLOCK_RETRY_TIME)) @@ -1042,8 +1041,8 @@ static struct i2o_block_device *i2o_block_device_alloc(void) static int i2o_block_probe(struct device *dev) { struct i2o_device *i2o_dev = to_i2o_device(dev); - struct i2o_block_device *i2o_blk_dev; struct i2o_controller *c = i2o_dev->iop; + struct i2o_block_device *i2o_blk_dev; struct gendisk *gd; struct request_queue *queue; static int unit = 0; diff --git a/drivers/message/i2o/i2o_block.h b/drivers/message/i2o/i2o_block.h index e45cc40ce384..4fdaa5bda412 100644 --- a/drivers/message/i2o/i2o_block.h +++ b/drivers/message/i2o/i2o_block.h @@ -64,40 +64,38 @@ /* I2O Block OSM mempool struct */ struct i2o_block_mempool { - kmem_cache_t *slab; - mempool_t *pool; + kmem_cache_t *slab; + mempool_t *pool; }; /* I2O Block device descriptor */ struct i2o_block_device { struct i2o_device *i2o_dev; /* pointer to I2O device */ struct gendisk *gd; - spinlock_t lock; /* queue lock */ + spinlock_t lock; /* queue lock */ struct list_head open_queue; /* list of transfered, but unfinished requests */ unsigned int open_queue_depth; /* number of requests in the queue */ - int rcache; /* read cache flags */ - int wcache; /* write cache flags */ + int rcache; /* read cache flags */ + int wcache; /* write cache flags */ int flags; - u16 power; /* power state */ - int media_change_flag; /* media changed flag */ + u16 power; /* power state */ + int media_change_flag; /* media changed flag */ }; /* I2O Block device request */ -struct i2o_block_request -{ +struct i2o_block_request { struct list_head queue; - struct request *req; /* corresponding request */ + struct request *req; /* corresponding request */ struct i2o_block_device *i2o_blk_dev; /* I2O block device */ - struct device *dev; /* device used for DMA */ - int sg_nents; /* number of SG elements */ - struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ + struct device *dev; /* device used for DMA */ + int sg_nents; /* number of SG elements */ + struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ }; /* I2O Block device delayed request */ -struct i2o_block_delayed_request -{ +struct i2o_block_delayed_request { struct work_struct work; struct request_queue *queue; }; diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 8160a1f6c73a..8ebc86ff1002 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c @@ -368,9 +368,9 @@ static int i2o_cfg_swul(unsigned long arg) i2o_dma_free(&c->pdev->dev, &buffer); -return_ret: + return_ret: return ret; -return_fault: + return_fault: ret = -EFAULT; goto return_ret; }; @@ -519,7 +519,8 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) #ifdef CONFIG_I2O_EXT_ADAPTEC #ifdef CONFIG_COMPAT -static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) +static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, + unsigned long arg) { struct i2o_cmd_passthru32 __user *cmd; struct i2o_controller *c; @@ -646,8 +647,9 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { // TODO 64bit fix if (copy_from_user - (p->virt, (void __user *)(unsigned long)sg[i].addr_bus, - sg_size)) { + (p->virt, + (void __user *)(unsigned long)sg[i]. + addr_bus, sg_size)) { printk(KERN_DEBUG "%s: Could not copy SG buf %d FROM user\n", c->name, i); @@ -738,11 +740,12 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar return rcode; } -static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) +static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, + unsigned long arg) { int ret; - lock_kernel(); - switch (cmd) { + lock_kernel(); + switch (cmd) { case I2OGETIOPS: ret = i2o_cfg_ioctl(NULL, file, cmd, arg); break; @@ -1136,6 +1139,7 @@ static int __init i2o_config_old_init(void) osm_err("can't register device.\n"); return -EBUSY; } + return 0; } diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index e5b74452c495..d559a1758363 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c @@ -28,7 +28,7 @@ */ #define OSM_NAME "proc-osm" -#define OSM_VERSION "$Rev$" +#define OSM_VERSION "1.145" #define OSM_DESCRIPTION "I2O ProcFS OSM" #define I2O_MAX_MODULES 4 diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index c32022bc2a21..42f8b810d6e5 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -117,13 +117,13 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) unsigned long flags; if (!ptr) - printk(KERN_ERR "%s: couldn't add NULL pointer to context list!" - "\n", c->name); + osm_err("%s: couldn't add NULL pointer to context list!\n", + c->name); entry = kmalloc(sizeof(*entry), GFP_ATOMIC); if (!entry) { - printk(KERN_ERR "%s: Could not allocate memory for context " - "list element\n", c->name); + osm_err("%s: Could not allocate memory for context list element" + "\n", c->name); return 0; } @@ -142,7 +142,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) spin_unlock_irqrestore(&c->context_list_lock, flags); - pr_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); + osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); return entry->context; }; @@ -174,11 +174,11 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void *ptr) spin_unlock_irqrestore(&c->context_list_lock, flags); if (!context) - printk(KERN_WARNING "%s: Could not remove nonexistent ptr " - "%p\n", c->name, ptr); + osm_warn("%s: Could not remove nonexistent ptr %p\n", c->name, + ptr); - pr_debug("%s: remove ptr from context list %d -> %p\n", c->name, - context, ptr); + osm_debug("%s: remove ptr from context list %d -> %p\n", c->name, + context, ptr); return context; }; @@ -208,11 +208,10 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context) spin_unlock_irqrestore(&c->context_list_lock, flags); if (!ptr) - printk(KERN_WARNING "%s: context id %d not found\n", c->name, - context); + osm_warn("%s: context id %d not found\n", c->name, context); - pr_debug("%s: get ptr from context list %d -> %p\n", c->name, context, - ptr); + osm_debug("%s: get ptr from context list %d -> %p\n", c->name, context, + ptr); return ptr; }; @@ -240,11 +239,11 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void *ptr) spin_unlock_irqrestore(&c->context_list_lock, flags); if (!context) - printk(KERN_WARNING "%s: Could not find nonexistent ptr " - "%p\n", c->name, ptr); + osm_warn("%s: Could not find nonexistent ptr %p\n", c->name, + ptr); - pr_debug("%s: get context id from context list %p -> %d\n", c->name, - ptr, context); + osm_debug("%s: get context id from context list %p -> %d\n", c->name, + ptr, context); return context; }; @@ -324,10 +323,9 @@ static int i2o_iop_quiesce(struct i2o_controller *c) /* Long timeout needed for quiesce if lots of devices */ if ((rc = i2o_msg_post_wait(c, m, 240))) - printk(KERN_INFO "%s: Unable to quiesce (status=%#x).\n", - c->name, -rc); + osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc); else - pr_debug("%s: Quiesced.\n", c->name); + osm_debug("%s: Quiesced.\n", c->name); i2o_status_get(c); // Entered READY state @@ -365,10 +363,9 @@ static int i2o_iop_enable(struct i2o_controller *c) /* How long of a timeout do we need? */ if ((rc = i2o_msg_post_wait(c, m, 240))) - printk(KERN_ERR "%s: Could not enable (status=%#x).\n", - c->name, -rc); + osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc); else - pr_debug("%s: Enabled.\n", c->name); + osm_debug("%s: Enabled.\n", c->name); i2o_status_get(c); // entered OPERATIONAL state @@ -432,10 +429,9 @@ static int i2o_iop_clear(struct i2o_controller *c) &msg->u.head[1]); if ((rc = i2o_msg_post_wait(c, m, 30))) - printk(KERN_INFO "%s: Unable to clear (status=%#x).\n", - c->name, -rc); + osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc); else - pr_debug("%s: Cleared.\n", c->name); + osm_debug("%s: Cleared.\n", c->name); /* Enable all IOPs */ i2o_iop_enable_all(); @@ -570,14 +566,13 @@ static int i2o_iop_reset(struct i2o_controller *c) * can't read one in the given ammount of time, we assume the * IOP could not reboot properly. */ - pr_debug("%s: Reset in progress, waiting for reboot...\n", - c->name); + osm_debug("%s: Reset in progress, waiting for reboot...\n", + c->name); m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); while (m == I2O_QUEUE_EMPTY) { if (time_after(jiffies, timeout)) { - printk(KERN_ERR "%s: IOP reset timeout.\n", - c->name); + osm_err("%s: IOP reset timeout.\n", c->name); rc = -ETIMEDOUT; goto exit; } @@ -635,29 +630,29 @@ static int i2o_iop_activate(struct i2o_controller *c) rc = i2o_status_get(c); if (rc) { - printk(KERN_INFO "%s: Unable to obtain status, " - "attempting a reset.\n", c->name); + osm_info("%s: Unable to obtain status, attempting a reset.\n", + c->name); rc = i2o_iop_reset(c); if (rc) return rc; } if (sb->i2o_version > I2OVER15) { - printk(KERN_ERR "%s: Not running version 1.5 of the I2O " - "Specification.\n", c->name); + osm_err("%s: Not running version 1.5 of the I2O Specification." + "\n", c->name); return -ENODEV; } switch (sb->iop_state) { case ADAPTER_STATE_FAULTED: - printk(KERN_CRIT "%s: hardware fault\n", c->name); + osm_err("%s: hardware fault\n", c->name); return -EFAULT; case ADAPTER_STATE_READY: case ADAPTER_STATE_OPERATIONAL: case ADAPTER_STATE_HOLD: case ADAPTER_STATE_FAILED: - pr_debug("%s: already running, trying to reset...\n", c->name); + osm_debug("%s: already running, trying to reset...\n", c->name); rc = i2o_iop_reset(c); if (rc) return rc; @@ -707,20 +702,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) res->flags = IORESOURCE_MEM; res->start = 0; res->end = 0; - printk(KERN_INFO "%s: requires private memory resources.\n", - c->name); + osm_info("%s: requires private memory resources.\n", c->name); root = pci_find_parent_resource(c->pdev, res); if (root == NULL) - printk(KERN_WARNING "%s: Can't find parent resource!\n", - c->name); + osm_warn("%s: Can't find parent resource!\n", c->name); 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 */ NULL, NULL) >= 0) { c->mem_alloc = 1; sb->current_mem_size = 1 + res->end - res->start; sb->current_mem_base = res->start; - printk(KERN_INFO "%s: allocated %ld bytes of PCI memory" - " at 0x%08lX.\n", c->name, - 1 + res->end - res->start, res->start); + osm_info("%s: allocated %ld bytes of PCI memory at " + "0x%08lX.\n", c->name, + 1 + res->end - res->start, res->start); } } @@ -730,20 +723,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) res->flags = IORESOURCE_IO; res->start = 0; res->end = 0; - printk(KERN_INFO "%s: requires private memory resources.\n", - c->name); + osm_info("%s: requires private memory resources.\n", c->name); root = pci_find_parent_resource(c->pdev, res); if (root == NULL) - printk(KERN_WARNING "%s: Can't find parent resource!\n", - c->name); + osm_warn("%s: Can't find parent resource!\n", c->name); 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 */ NULL, NULL) >= 0) { c->io_alloc = 1; sb->current_io_size = 1 + res->end - res->start; sb->current_mem_base = res->start; - printk(KERN_INFO "%s: allocated %ld bytes of PCI I/O at" - " 0x%08lX.\n", c->name, - 1 + res->end - res->start, res->start); + osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX" + ".\n", c->name, 1 + res->end - res->start, + res->start); } } @@ -787,10 +778,10 @@ static int i2o_iop_systab_set(struct i2o_controller *c) PCI_DMA_TODEVICE); if (rc < 0) - printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", - c->name, -rc); + osm_err("%s: Unable to set SysTab (status=%#x).\n", c->name, + -rc); else - pr_debug("%s: SysTab set.\n", c->name); + osm_debug("%s: SysTab set.\n", c->name); i2o_status_get(c); // Entered READY state @@ -814,7 +805,7 @@ static int i2o_iop_online(struct i2o_controller *c) return rc; /* In READY state */ - pr_debug("%s: Attempting to enable...\n", c->name); + osm_debug("%s: Attempting to enable...\n", c->name); rc = i2o_iop_enable(c); if (rc) return rc; @@ -833,7 +824,7 @@ void i2o_iop_remove(struct i2o_controller *c) { struct i2o_device *dev, *tmp; - pr_debug("%s: deleting controller\n", c->name); + osm_debug("%s: deleting controller\n", c->name); i2o_driver_notify_controller_remove_all(c); @@ -882,8 +873,7 @@ static int i2o_systab_build(void) systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); if (!systab) { - printk(KERN_ERR "i2o: unable to allocate memory for System " - "Table\n"); + osm_err("unable to allocate memory for System Table\n"); return -ENOMEM; } memset(systab, 0, i2o_systab.len); @@ -895,8 +885,8 @@ static int i2o_systab_build(void) i2o_status_block *sb; if (count >= num_controllers) { - printk(KERN_ERR "i2o: controller added while building " - "system table\n"); + osm_err("controller added while building system table" + "\n"); break; } @@ -910,9 +900,8 @@ static int i2o_systab_build(void) * it is techninically not part of the I2O subsystem... */ if (unlikely(i2o_status_get(c))) { - printk(KERN_ERR "%s: Deleting b/c could not get status" - " while attempting to build system table\n", - c->name); + osm_err("%s: Deleting b/c could not get status while " + "attempting to build system table\n", c->name); i2o_iop_remove(c); continue; // try the next one } @@ -994,7 +983,7 @@ int i2o_status_get(struct i2o_controller *c) timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; while (status_block[87] != 0xFF) { if (time_after(jiffies, timeout)) { - printk(KERN_ERR "%s: Get status timeout.\n", c->name); + osm_err("%s: Get status timeout.\n", c->name); return -ETIMEDOUT; } @@ -1043,8 +1032,8 @@ static int i2o_hrt_get(struct i2o_controller *c) rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); if (rc < 0) { - printk(KERN_ERR "%s: Unable to get HRT (status=%#x)\n", - c->name, -rc); + osm_err("%s: Unable to get HRT (status=%#x)\n", c->name, + -rc); return rc; } @@ -1058,8 +1047,8 @@ static int i2o_hrt_get(struct i2o_controller *c) return i2o_parse_hrt(c); } - printk(KERN_ERR "%s: Unable to get HRT after %d tries, giving up\n", - c->name, I2O_HRT_GET_TRIES); + osm_err("%s: Unable to get HRT after %d tries, giving up\n", c->name, + I2O_HRT_GET_TRIES); return -EBUSY; } @@ -1073,7 +1062,6 @@ void i2o_iop_free(struct i2o_controller *c) kfree(c); }; - /** * i2o_iop_release - release the memory for a I2O controller * @dev: I2O controller which should be released @@ -1109,8 +1097,8 @@ struct i2o_controller *i2o_iop_alloc(void) c = kmalloc(sizeof(*c), GFP_KERNEL); if (!c) { - printk(KERN_ERR "i2o: Insufficient memory to allocate a I2O " - "controller.\n"); + osm_err("i2o: Insufficient memory to allocate a I2O controller." + "\n"); return ERR_PTR(-ENOMEM); } memset(c, 0, sizeof(*c)); diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index 442e34506b90..9971430e5184 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c @@ -179,7 +179,10 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) return -ENOMEM; } - if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) { + if (i2o_dma_alloc + (dev, &c->out_queue, + I2O_MAX_OUTBOUND_MSG_FRAMES * I2O_OUTBOUND_MSG_FRAME_SIZE * + sizeof(u32), GFP_KERNEL)) { i2o_pci_free(c); return -ENOMEM; } |