diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd_eer.c | 2 | ||||
-rw-r--r-- | drivers/s390/block/dasd_proc.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/fs3270.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/monreader.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/monwriter.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/tape_char.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/tape_class.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/tape_class.h | 2 | ||||
-rw-r--r-- | drivers/s390/char/tape_proc.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/vmcp.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/vmlogrdr.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/vmwatchdog.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/blacklist.c | 2 | ||||
-rw-r--r-- | drivers/s390/cio/device_id.c | 3 | ||||
-rw-r--r-- | drivers/s390/cio/device_ops.c | 32 | ||||
-rw-r--r-- | drivers/s390/cio/qdio.c | 2 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/qeth_proc.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 22 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 23 |
23 files changed, 71 insertions, 54 deletions
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index 6cedc914077..4b8a95fba1e 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c @@ -650,7 +650,7 @@ static unsigned int dasd_eer_poll(struct file *filp, poll_table *ptable) return mask; } -static struct file_operations dasd_eer_fops = { +static const struct file_operations dasd_eer_fops = { .open = &dasd_eer_open, .release = &dasd_eer_close, .read = &dasd_eer_read, diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 8b7e11815d7..8b3b0f4a157 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -147,7 +147,7 @@ static int dasd_devices_open(struct inode *inode, struct file *file) return seq_open(file, &dasd_devices_seq_ops); } -static struct file_operations dasd_devices_file_ops = { +static const struct file_operations dasd_devices_file_ops = { .open = dasd_devices_open, .read = seq_read, .llseek = seq_lseek, diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index e1a746269c4..ef36f2132aa 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -493,7 +493,7 @@ fs3270_close(struct inode *inode, struct file *filp) return 0; } -static struct file_operations fs3270_fops = { +static const struct file_operations fs3270_fops = { .owner = THIS_MODULE, /* owner */ .read = fs3270_read, /* read */ .write = fs3270_write, /* write */ diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index 3a1a958fb5f..8df7b1323c0 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -547,7 +547,7 @@ static unsigned int mon_poll(struct file *filp, struct poll_table_struct *p) return 0; } -static struct file_operations mon_fops = { +static const struct file_operations mon_fops = { .owner = THIS_MODULE, .open = &mon_open, .release = &mon_close, diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index 9e451acc649..268598ef3ef 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c @@ -255,7 +255,7 @@ out_error: return rc; } -static struct file_operations monwrite_fops = { +static const struct file_operations monwrite_fops = { .owner = THIS_MODULE, .open = &monwrite_open, .release = &monwrite_close, diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 9faea04e11e..b830a8cbef7 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c @@ -39,7 +39,7 @@ static int tapechar_ioctl(struct inode *, struct file *, unsigned int, static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); -static struct file_operations tape_fops = +static const struct file_operations tape_fops = { .owner = THIS_MODULE, .read = tapechar_read, diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 56b87618b10..2e0d29730b6 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -36,7 +36,7 @@ static struct class *tape_class; struct tape_class_device *register_tape_dev( struct device * device, dev_t dev, - struct file_operations *fops, + const struct file_operations *fops, char * device_name, char * mode_name) { diff --git a/drivers/s390/char/tape_class.h b/drivers/s390/char/tape_class.h index 3d0ca054cde..a8bd9b47fad 100644 --- a/drivers/s390/char/tape_class.h +++ b/drivers/s390/char/tape_class.h @@ -52,7 +52,7 @@ struct tape_class_device { struct tape_class_device *register_tape_dev( struct device * device, dev_t dev, - struct file_operations *fops, + const struct file_operations *fops, char * device_name, char * node_name ); diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c index 655d375ab22..cea49f001f8 100644 --- a/drivers/s390/char/tape_proc.c +++ b/drivers/s390/char/tape_proc.c @@ -109,7 +109,7 @@ static int tape_proc_open(struct inode *inode, struct file *file) return seq_open(file, &tape_proc_seq); } -static struct file_operations tape_proc_ops = +static const struct file_operations tape_proc_ops = { .open = tape_proc_open, .read = seq_read, diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index a420cd09904..fce3dac5cb3 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c @@ -173,7 +173,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } } -static struct file_operations vmcp_fops = { +static const struct file_operations vmcp_fops = { .owner = THIS_MODULE, .open = &vmcp_open, .release = &vmcp_release, diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 8432a76b961..b87d3b01993 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -88,7 +88,7 @@ static int vmlogrdr_release(struct inode *, struct file *); static ssize_t vmlogrdr_read (struct file *filp, char __user *data, size_t count, loff_t * ppos); -static struct file_operations vmlogrdr_fops = { +static const struct file_operations vmlogrdr_fops = { .owner = THIS_MODULE, .open = vmlogrdr_open, .release = vmlogrdr_release, diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c index 4b868f72fe8..680b9b58b80 100644 --- a/drivers/s390/char/vmwatchdog.c +++ b/drivers/s390/char/vmwatchdog.c @@ -228,7 +228,7 @@ static ssize_t vmwdt_write(struct file *f, const char __user *buf, return count; } -static struct file_operations vmwdt_fops = { +static const struct file_operations vmwdt_fops = { .open = &vmwdt_open, .release = &vmwdt_close, .ioctl = &vmwdt_ioctl, diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index aa65df4dfce..ec0404874fa 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c @@ -364,7 +364,7 @@ cio_ignore_proc_open(struct inode *inode, struct file *file) return seq_open(file, &cio_ignore_proc_seq_ops); } -static struct file_operations cio_ignore_proc_fops = { +static const struct file_operations cio_ignore_proc_fops = { .open = cio_ignore_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index f17275917fe..997f4687453 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/init.h> +#include <linux/kernel.h> #include <asm/ccwdev.h> #include <asm/delay.h> @@ -138,7 +139,7 @@ VM_virtual_device_info (__u16 devno, struct senseid *ps) ps->cu_model = 0x60; return; } - for (i = 0; i < sizeof(vm_devices) / sizeof(vm_devices[0]); i++) + for (i = 0; i < ARRAY_SIZE(vm_devices); i++) if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla && diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) { ps->cu_type = vm_devices[i].cu_type; diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index d7b25b8f71d..7c7775aae38 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -23,8 +23,7 @@ #include "chsc.h" #include "device.h" -int -ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) +int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags) { /* * The flag usage is mutal exclusive ... @@ -39,6 +38,33 @@ ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) return 0; } +int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) +{ + /* + * The flag usage is mutal exclusive ... + */ + if (((flags & CCWDEV_EARLY_NOTIFICATION) && + (flags & CCWDEV_REPORT_ALL)) || + ((flags & CCWDEV_EARLY_NOTIFICATION) && + cdev->private->options.repall) || + ((flags & CCWDEV_REPORT_ALL) && + cdev->private->options.fast)) + return -EINVAL; + cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0; + cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0; + cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0; + cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0; + return 0; +} + +void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags) +{ + cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0; + cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0; + cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0; + cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0; +} + int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) { @@ -601,7 +627,9 @@ _ccw_device_get_device_number(struct ccw_device *cdev) MODULE_LICENSE("GPL"); +EXPORT_SYMBOL(ccw_device_set_options_mask); EXPORT_SYMBOL(ccw_device_set_options); +EXPORT_SYMBOL(ccw_device_clear_options); EXPORT_SYMBOL(ccw_device_clear); EXPORT_SYMBOL(ccw_device_halt); EXPORT_SYMBOL(ccw_device_resume); diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index d726cd5777d..5b1e3ff26c0 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -3194,7 +3194,7 @@ qdio_establish(struct qdio_initialize *init_data) spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); - ccw_device_set_options(cdev, 0); + ccw_device_set_options_mask(cdev, 0); result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, QDIO_DOING_ESTABLISH,0, 0, QDIO_ESTABLISH_TIMEOUT); diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index b9e59bc9435..99761391f34 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -807,7 +807,7 @@ static long zcrypt_compat_ioctl(struct file *filp, unsigned int cmd, /** * Misc device file operations. */ -static struct file_operations zcrypt_fops = { +static const struct file_operations zcrypt_fops = { .owner = THIS_MODULE, .read = zcrypt_read, .write = zcrypt_write, @@ -1063,7 +1063,6 @@ int __init zcrypt_api_init(void) rc = -ENOMEM; goto out_misc; } - zcrypt_entry->nlink = 1; zcrypt_entry->data = NULL; zcrypt_entry->read_proc = zcrypt_status_read; zcrypt_entry->write_proc = zcrypt_status_write; diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index b97dd15bdb9..ecca1046714 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1511,8 +1511,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer) LCS_DBF_TEXT(5, trace, "txbuffcb"); /* Put buffer back to pool. */ lcs_release_buffer(channel, buffer); - card = (struct lcs_card *) - ((char *) channel - offsetof(struct lcs_card, write)); + card = container_of(channel, struct lcs_card, write); if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev)) netif_wake_queue(card->dev); spin_lock(&card->lock); @@ -1810,8 +1809,7 @@ lcs_get_frames_cb(struct lcs_channel *channel, struct lcs_buffer *buffer) LCS_DBF_TEXT(4, trace, "-eiogpkt"); return; } - card = (struct lcs_card *) - ((char *) channel - offsetof(struct lcs_card, read)); + card = container_of(channel, struct lcs_card, read); offset = 0; while (lcs_hdr->offset != 0) { if (lcs_hdr->offset <= 0 || diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index faa768e5925..81f805cc5ee 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -161,7 +161,7 @@ qeth_procfile_open(struct inode *inode, struct file *file) return seq_open(file, &qeth_procfile_seq_ops); } -static struct file_operations qeth_procfile_fops = { +static const struct file_operations qeth_procfile_fops = { .owner = THIS_MODULE, .open = qeth_procfile_open, .read = seq_read, @@ -273,7 +273,7 @@ qeth_perf_procfile_open(struct inode *inode, struct file *file) return seq_open(file, &qeth_perf_procfile_seq_ops); } -static struct file_operations qeth_perf_procfile_fops = { +static const struct file_operations qeth_perf_procfile_fops = { .owner = THIS_MODULE, .open = qeth_perf_procfile_open, .read = seq_read, diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 39a88526679..1f9554e0801 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -60,7 +60,7 @@ static long zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long); _IOWR(ZFCP_CFDC_IOC_MAGIC, 0, struct zfcp_cfdc_sense_data) -static struct file_operations zfcp_cfdc_fops = { +static const struct file_operations zfcp_cfdc_fops = { .unlocked_ioctl = zfcp_cfdc_dev_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = zfcp_cfdc_dev_ioctl diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 88642dec080..421da1e7c0e 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -838,32 +838,28 @@ zfcp_erp_action_exists(struct zfcp_erp_action *erp_action) * and does appropriate preparations (dismiss fsf request, ...) * * locks: called under erp_lock (disabled interrupts) - * - * returns: 0 */ -static int +static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) { - int retval = 0; - struct zfcp_fsf_req *fsf_req = NULL; struct zfcp_adapter *adapter = erp_action->adapter; if (erp_action->fsf_req) { /* take lock to ensure that request is not deleted meanwhile */ spin_lock(&adapter->req_list_lock); - if ((!zfcp_reqlist_ismember(adapter, - erp_action->fsf_req->req_id)) && - (fsf_req->erp_action == erp_action)) { + if (zfcp_reqlist_ismember(adapter, + erp_action->fsf_req->req_id)) { /* fsf_req still exists */ debug_text_event(adapter->erp_dbf, 3, "a_ca_req"); - debug_event(adapter->erp_dbf, 3, &fsf_req, + debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req, sizeof (unsigned long)); /* dismiss fsf_req of timed out/dismissed erp_action */ if (erp_action->status & (ZFCP_STATUS_ERP_DISMISSED | ZFCP_STATUS_ERP_TIMEDOUT)) { debug_text_event(adapter->erp_dbf, 3, "a_ca_disreq"); - fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; + erp_action->fsf_req->status |= + ZFCP_STATUS_FSFREQ_DISMISSED; } if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { ZFCP_LOG_NORMAL("error: erp step timed out " @@ -876,11 +872,11 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) * then keep it running asynchronously and don't mess * with the association of erp_action and fsf_req. */ - if (fsf_req->status & (ZFCP_STATUS_FSFREQ_COMPLETED | + if (erp_action->fsf_req->status & + (ZFCP_STATUS_FSFREQ_COMPLETED | ZFCP_STATUS_FSFREQ_DISMISSED)) { /* forget about association between fsf_req and erp_action */ - fsf_req->erp_action = NULL; erp_action->fsf_req = NULL; } } else { @@ -894,8 +890,6 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) spin_unlock(&adapter->req_list_lock); } else debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); - - return retval; } /** diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index cda0cc095ad..01386ac688a 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -89,7 +89,7 @@ extern int zfcp_fsf_control_file(struct zfcp_adapter *, struct zfcp_fsf_req **, u32, u32, struct zfcp_sg_list *); extern void zfcp_fsf_start_timer(struct zfcp_fsf_req *, unsigned long); extern void zfcp_erp_start_timer(struct zfcp_fsf_req *); -extern int zfcp_fsf_req_dismiss_all(struct zfcp_adapter *); +extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *); extern int zfcp_fsf_status_read(struct zfcp_adapter *, int); extern int zfcp_fsf_req_create(struct zfcp_adapter *, u32, int, mempool_t *, unsigned long *, struct zfcp_fsf_req **); diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 4b3ae3f22e7..ef16f7ca4bb 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -176,28 +176,25 @@ static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter, /** * zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests */ -int zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) +void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) { struct zfcp_fsf_req *request, *tmp; unsigned long flags; + LIST_HEAD(remove_queue); unsigned int i, counter; spin_lock_irqsave(&adapter->req_list_lock, flags); atomic_set(&adapter->reqs_active, 0); - for (i=0; i<REQUEST_LIST_SIZE; i++) { - if (list_empty(&adapter->req_list[i])) - continue; - - counter = 0; - list_for_each_entry_safe(request, tmp, - &adapter->req_list[i], list) { - zfcp_fsf_req_dismiss(adapter, request, counter); - counter++; - } - } + for (i=0; i<REQUEST_LIST_SIZE; i++) + list_splice_init(&adapter->req_list[i], &remove_queue); + spin_unlock_irqrestore(&adapter->req_list_lock, flags); - return 0; + counter = 0; + list_for_each_entry_safe(request, tmp, &remove_queue, list) { + zfcp_fsf_req_dismiss(adapter, request, counter); + counter++; + } } /* |