diff options
Diffstat (limited to 'drivers/staging/i2o')
-rw-r--r-- | drivers/staging/i2o/bus-osm.c | 3 | ||||
-rw-r--r-- | drivers/staging/i2o/config-osm.c | 2 | ||||
-rw-r--r-- | drivers/staging/i2o/debug.c | 7 | ||||
-rw-r--r-- | drivers/staging/i2o/device.c | 4 | ||||
-rw-r--r-- | drivers/staging/i2o/driver.c | 7 | ||||
-rw-r--r-- | drivers/staging/i2o/exec-osm.c | 4 | ||||
-rw-r--r-- | drivers/staging/i2o/i2o_block.c | 26 | ||||
-rw-r--r-- | drivers/staging/i2o/i2o_config.c | 5 | ||||
-rw-r--r-- | drivers/staging/i2o/i2o_proc.c | 26 | ||||
-rw-r--r-- | drivers/staging/i2o/iop.c | 26 | ||||
-rw-r--r-- | drivers/staging/i2o/memory.c | 3 | ||||
-rw-r--r-- | drivers/staging/i2o/pci.c | 9 |
12 files changed, 67 insertions, 55 deletions
diff --git a/drivers/staging/i2o/bus-osm.c b/drivers/staging/i2o/bus-osm.c index 7aa0339aea05..43e357eeeb67 100644 --- a/drivers/staging/i2o/bus-osm.c +++ b/drivers/staging/i2o/bus-osm.c @@ -69,7 +69,8 @@ static ssize_t i2o_bus_store_scan(struct device *d, struct i2o_device *i2o_dev = to_i2o_device(d); int rc; - if ((rc = i2o_bus_scan(i2o_dev))) + rc = i2o_bus_scan(i2o_dev); + if (rc) osm_warn("bus scan failed %d\n", rc); return count; diff --git a/drivers/staging/i2o/config-osm.c b/drivers/staging/i2o/config-osm.c index 519f52f9f688..45091ac66154 100644 --- a/drivers/staging/i2o/config-osm.c +++ b/drivers/staging/i2o/config-osm.c @@ -19,7 +19,7 @@ #include <linux/namei.h> #include <linux/fs.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #define OSM_NAME "config-osm" #define OSM_VERSION "1.323" diff --git a/drivers/staging/i2o/debug.c b/drivers/staging/i2o/debug.c index 7a16114ed8ea..12b783b2a86c 100644 --- a/drivers/staging/i2o/debug.c +++ b/drivers/staging/i2o/debug.c @@ -5,7 +5,7 @@ static void i2o_report_util_cmd(u8 cmd); static void i2o_report_exec_cmd(u8 cmd); -static void i2o_report_fail_status(u8 req_status, u32 * msg); +static void i2o_report_fail_status(u8 req_status, u32 *msg); static void i2o_report_common_status(u8 req_status); static void i2o_report_common_dsc(u16 detailed_status); @@ -22,7 +22,7 @@ void i2o_report_status(const char *severity, const char *str, u16 detailed_status = msg[4] & 0xFFFF; if (cmd == I2O_CMD_UTIL_EVT_REGISTER) - return; // No status in this reply + return; /* No status in this reply */ printk("%s%s: ", severity, str); @@ -54,6 +54,7 @@ void i2o_dump_message(struct i2o_message *m) #ifdef DEBUG u32 *msg = (u32 *) m; int i; + printk(KERN_INFO "Dumping I2O message size %d @ %p\n", msg[0] >> 16 & 0xffff, msg); for (i = 0; i < ((msg[0] >> 16) & 0xffff); i++) @@ -66,7 +67,7 @@ void i2o_dump_message(struct i2o_message *m) * Following fail status are common to all classes. * The preserved message must be handled in the reply handler. */ -static void i2o_report_fail_status(u8 req_status, u32 * msg) +static void i2o_report_fail_status(u8 req_status, u32 *msg) { static char *FAIL_STATUS[] = { "0x80", /* not used */ diff --git a/drivers/staging/i2o/device.c b/drivers/staging/i2o/device.c index 2af22553dd4e..e47496cb0ac2 100644 --- a/drivers/staging/i2o/device.c +++ b/drivers/staging/i2o/device.c @@ -565,10 +565,8 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group, size += 4 - size % 4; opblk = kmalloc(size, GFP_KERNEL); - if (opblk == NULL) { - printk(KERN_ERR "i2o: no memory for query buffer.\n"); + if (opblk == NULL) return -ENOMEM; - } opblk[0] = 1; /* operation count */ opblk[1] = 0; /* pad */ diff --git a/drivers/staging/i2o/driver.c b/drivers/staging/i2o/driver.c index 111c3edde035..06119bb3eb5f 100644 --- a/drivers/staging/i2o/driver.c +++ b/drivers/staging/i2o/driver.c @@ -102,8 +102,7 @@ int i2o_driver_register(struct i2o_driver *drv) for (i = 0; i2o_drivers[i]; i++) if (i >= i2o_max_drivers) { - osm_err("too many drivers registered, increase " - "max_drivers\n"); + osm_err("too many drivers registered, increase max_drivers\n"); spin_unlock_irqrestore(&i2o_drivers_lock, flags); rc = -EFAULT; goto out; @@ -244,8 +243,8 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m) } if (unlikely(!drv->reply)) { - osm_debug("%s: Reply to driver %s, but no reply function" - " defined!\n", c->name, drv->name); + osm_debug("%s: Reply to driver %s, but no reply function defined!\n", + c->name, drv->name); return -EIO; } diff --git a/drivers/staging/i2o/exec-osm.c b/drivers/staging/i2o/exec-osm.c index 16d857d5e655..dce16e425a6e 100644 --- a/drivers/staging/i2o/exec-osm.c +++ b/drivers/staging/i2o/exec-osm.c @@ -507,8 +507,8 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, * to aid in debugging. * */ - printk(KERN_WARNING "%s: Unsolicited message reply sent to core!" - "Message dumped to syslog\n", c->name); + printk(KERN_WARNING "%s: Unsolicited message reply sent to core! Message dumped to syslog\n", + c->name); i2o_dump_message(msg); return -EFAULT; diff --git a/drivers/staging/i2o/i2o_block.c b/drivers/staging/i2o/i2o_block.c index 0a13c64ce000..406758f755ee 100644 --- a/drivers/staging/i2o/i2o_block.c +++ b/drivers/staging/i2o/i2o_block.c @@ -871,13 +871,13 @@ static int i2o_block_transfer(struct request *req) return 0; - context_remove: +context_remove: i2o_cntxt_list_remove(c, req); - nop_msg: +nop_msg: i2o_msg_nop(c, msg); - exit: +exit: return rc; }; @@ -1002,13 +1002,13 @@ static struct i2o_block_device *i2o_block_device_alloc(void) return dev; - cleanup_queue: +cleanup_queue: put_disk(gd); - cleanup_dev: +cleanup_dev: kfree(dev); - exit: +exit: return ERR_PTR(rc); }; @@ -1028,7 +1028,7 @@ static int i2o_block_probe(struct device *dev) struct i2o_block_device *i2o_blk_dev; struct gendisk *gd; struct request_queue *queue; - static int unit = 0; + static int unit; int rc; u64 size; u32 blocksize; @@ -1115,10 +1115,10 @@ static int i2o_block_probe(struct device *dev) return 0; - claim_release: +claim_release: i2o_device_claim_release(i2o_dev); - exit: +exit: return rc; }; @@ -1187,16 +1187,16 @@ static int __init i2o_block_init(void) return 0; - unregister_blkdev: +unregister_blkdev: unregister_blkdev(I2O_MAJOR, "i2o_block"); - free_mempool: +free_mempool: mempool_destroy(i2o_blk_req_pool.pool); - free_slab: +free_slab: kmem_cache_destroy(i2o_blk_req_pool.slab); - exit: +exit: return rc; }; diff --git a/drivers/staging/i2o/i2o_config.c b/drivers/staging/i2o/i2o_config.c index 04bd3b6de401..cd7ca5eb18ff 100644 --- a/drivers/staging/i2o/i2o_config.c +++ b/drivers/staging/i2o/i2o_config.c @@ -34,8 +34,7 @@ #include <linux/mutex.h> #include <linux/compat.h> #include <linux/slab.h> - -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "core.h" @@ -65,7 +64,7 @@ struct i2o_cfg_info { struct i2o_cfg_info *next; }; static struct i2o_cfg_info *open_files = NULL; -static ulong i2o_cfg_info_id = 0; +static ulong i2o_cfg_info_id; static int i2o_cfg_getiops(unsigned long arg) { diff --git a/drivers/staging/i2o/i2o_proc.c b/drivers/staging/i2o/i2o_proc.c index ad84f3304f3c..780fee3224ea 100644 --- a/drivers/staging/i2o/i2o_proc.c +++ b/drivers/staging/i2o/i2o_proc.c @@ -48,9 +48,9 @@ #include <linux/errno.h> #include <linux/spinlock.h> #include <linux/workqueue.h> +#include <linux/uaccess.h> #include <asm/io.h> -#include <asm/uaccess.h> #include <asm/byteorder.h> /* Structure used to define /proc entries */ @@ -85,9 +85,8 @@ static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len) switch (serialno[0]) { case I2O_SNFORMAT_BINARY: /* Binary */ seq_printf(seq, "0x"); - for (i = 0; i < serialno[1]; i++) { + for (i = 0; i < serialno[1]; i++) seq_printf(seq, "%02X", serialno[2 + i]); - } break; case I2O_SNFORMAT_ASCII: /* ASCII */ @@ -101,9 +100,8 @@ static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len) seq_printf(seq, "%s", &serialno[2]); } else { /* print chars for specified length */ - for (i = 0; i < serialno[1]; i++) { + for (i = 0; i < serialno[1]; i++) seq_printf(seq, "%c", serialno[2 + i]); - } } break; @@ -266,16 +264,22 @@ static int i2o_report_query_status(struct seq_file *seq, int block_status, { switch (block_status) { case -ETIMEDOUT: - return seq_printf(seq, "Timeout reading group %s.\n", group); + seq_printf(seq, "Timeout reading group %s.\n", group); + break; case -ENOMEM: - return seq_printf(seq, "No free memory to read the table.\n"); + seq_puts(seq, "No free memory to read the table.\n"); + break; case -I2O_PARAMS_STATUS_INVALID_GROUP_ID: - return seq_printf(seq, "Group %s not supported.\n", group); + seq_printf(seq, "Group %s not supported.\n", group); + break; default: - return seq_printf(seq, - "Error reading group %s. BlockStatus 0x%02X\n", - group, -block_status); + seq_printf(seq, + "Error reading group %s. BlockStatus 0x%02X\n", + group, -block_status); + break; } + + return 0; } static char *bus_strings[] = { diff --git a/drivers/staging/i2o/iop.c b/drivers/staging/i2o/iop.c index 52334fc8b547..23bdbe4aa480 100644 --- a/drivers/staging/i2o/iop.c +++ b/drivers/staging/i2o/iop.c @@ -1042,7 +1042,7 @@ static void i2o_iop_release(struct device *dev) */ struct i2o_controller *i2o_iop_alloc(void) { - static int unit = 0; /* 0 and 1 are NULL IOP and Local Host */ + static int unit; /* 0 and 1 are NULL IOP and Local Host */ struct i2o_controller *c; char poolname[32]; @@ -1096,7 +1096,8 @@ int i2o_iop_add(struct i2o_controller *c) { int rc; - if ((rc = device_add(&c->device))) { + rc = device_add(&c->device); + if (rc) { osm_err("%s: could not add controller\n", c->name); goto iop_reset; } @@ -1105,24 +1106,28 @@ int i2o_iop_add(struct i2o_controller *c) osm_info("%s: This may take a few minutes if there are many devices\n", c->name); - if ((rc = i2o_iop_activate(c))) { + rc = i2o_iop_activate(c); + if (rc) { osm_err("%s: could not activate controller\n", c->name); goto device_del; } osm_debug("%s: building sys table...\n", c->name); - if ((rc = i2o_systab_build())) + rc = i2o_systab_build(); + if (rc) goto device_del; osm_debug("%s: online controller...\n", c->name); - if ((rc = i2o_iop_online(c))) + rc = i2o_iop_online(c); + if (rc) goto device_del; osm_debug("%s: getting LCT...\n", c->name); - if ((rc = i2o_exec_lct_get(c))) + rc = i2o_exec_lct_get(c); + if (rc) goto device_del; list_add(&c->list, &i2o_controllers); @@ -1192,13 +1197,16 @@ static int __init i2o_iop_init(void) printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); - if ((rc = i2o_driver_init())) + rc = i2o_driver_init(); + if (rc) goto exit; - if ((rc = i2o_exec_init())) + rc = i2o_exec_init(); + if (rc) goto driver_exit; - if ((rc = i2o_pci_init())) + rc = i2o_pci_init(); + if (rc) goto exec_exit; return 0; diff --git a/drivers/staging/i2o/memory.c b/drivers/staging/i2o/memory.c index 8f9509d275a4..78b702c18537 100644 --- a/drivers/staging/i2o/memory.c +++ b/drivers/staging/i2o/memory.c @@ -270,10 +270,9 @@ EXPORT_SYMBOL_GPL(i2o_dma_realloc); int i2o_pool_alloc(struct i2o_pool *pool, const char *name, size_t size, int min_nr) { - pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL); + pool->name = kstrdup(name, GFP_KERNEL); if (!pool->name) goto exit; - strcpy(pool->name, name); pool->slab = kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL); diff --git a/drivers/staging/i2o/pci.c b/drivers/staging/i2o/pci.c index b3b8a61dd4a6..49804c9cf74f 100644 --- a/drivers/staging/i2o/pci.c +++ b/drivers/staging/i2o/pci.c @@ -329,7 +329,8 @@ static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) return -ENODEV; } - if ((rc = pci_enable_device(pdev))) { + rc = pci_enable_device(pdev); + if (rc) { printk(KERN_WARNING "i2o: couldn't enable device %s\n", pci_name(pdev)); return rc; @@ -410,7 +411,8 @@ static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) #endif } - if ((rc = i2o_pci_alloc(c))) { + rc = i2o_pci_alloc(c); + if (rc) { printk(KERN_ERR "%s: DMA / IO allocation for I2O controller " "failed\n", c->name); goto free_controller; @@ -422,7 +424,8 @@ static int i2o_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto free_pci; } - if ((rc = i2o_iop_add(c))) + rc = i2o_iop_add(c); + if (rc) goto uninstall; if (i960) |