diff options
Diffstat (limited to 'drivers/s390/char')
-rw-r--r-- | drivers/s390/char/con3215.c | 25 | ||||
-rw-r--r-- | drivers/s390/char/fs3270.c | 20 | ||||
-rw-r--r-- | drivers/s390/char/sclp_cpi.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/sclp_quiesce.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/sclp_tty.c | 21 | ||||
-rw-r--r-- | drivers/s390/char/sclp_vt220.c | 12 | ||||
-rw-r--r-- | drivers/s390/char/tape_block.c | 4 | ||||
-rw-r--r-- | drivers/s390/char/tape_char.c | 20 | ||||
-rw-r--r-- | drivers/s390/char/vmwatchdog.c | 2 |
9 files changed, 54 insertions, 54 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 75419cf9d35..1f060914cfa 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -16,6 +16,7 @@ #include <linux/types.h> #include <linux/kdev_t.h> #include <linux/tty.h> +#include <linux/tty_flip.h> #include <linux/vt_kern.h> #include <linux/init.h> #include <linux/console.h> @@ -432,8 +433,6 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) if (count > slen) count = slen; } else - if (count >= TTY_FLIPBUF_SIZE - tty->flip.count) - count = TTY_FLIPBUF_SIZE - tty->flip.count - 1; EBCASC(raw->inbuf, count); cchar = ctrlchar_handle(raw->inbuf, count, tty); switch (cchar & CTRLCHAR_MASK) { @@ -441,28 +440,20 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) break; case CTRLCHAR_CTRL: - tty->flip.count++; - *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *tty->flip.char_buf_ptr++ = cchar; + tty_insert_flip_char(tty, cchar, TTY_NORMAL); tty_flip_buffer_push(raw->tty); break; case CTRLCHAR_NONE: - memcpy(tty->flip.char_buf_ptr, - raw->inbuf, count); if (count < 2 || - (strncmp(raw->inbuf+count-2, "^n", 2) && - strncmp(raw->inbuf+count-2, "\252n", 2)) ) { - /* don't add the auto \n */ - tty->flip.char_buf_ptr[count] = '\n'; - memset(tty->flip.flag_buf_ptr, - TTY_NORMAL, count + 1); + (strncmp(raw->inbuf+count-2, "\252n", 2) && + strncmp(raw->inbuf+count-2, "^n", 2)) ) { + /* add the auto \n */ + raw->inbuf[count] = '\n'; count++; } else - count-=2; - tty->flip.char_buf_ptr += count; - tty->flip.flag_buf_ptr += count; - tty->flip.count += count; + count -= 2; + tty_insert_flip_string(tty, raw->inbuf, count); tty_flip_buffer_push(raw->tty); break; } diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 735a7fcdeff..5f6fa4c6784 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -319,9 +319,8 @@ fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off) /* * process ioctl commands for the tube driver */ -static int -fs3270_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) +static long +fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct fs3270 *fp; struct raw3270_iocb iocb; @@ -331,6 +330,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp, if (!fp) return -ENODEV; rc = 0; + lock_kernel(); switch (cmd) { case TUBICMD: fp->read_command = arg; @@ -356,6 +356,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp, rc = -EFAULT; break; } + unlock_kernel(); return rc; } @@ -491,12 +492,13 @@ fs3270_close(struct inode *inode, struct file *filp) } static struct file_operations fs3270_fops = { - .owner = THIS_MODULE, /* owner */ - .read = fs3270_read, /* read */ - .write = fs3270_write, /* write */ - .ioctl = fs3270_ioctl, /* ioctl */ - .open = fs3270_open, /* open */ - .release = fs3270_close, /* release */ + .owner = THIS_MODULE, /* owner */ + .read = fs3270_read, /* read */ + .write = fs3270_write, /* write */ + .unlocked_ioctl = fs3270_ioctl, /* ioctl */ + .compat_ioctl = fs3270_ioctl, /* ioctl */ + .open = fs3270_open, /* open */ + .release = fs3270_close, /* release */ }; /* diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c index 5a6cef2dfa1..80f7f31310e 100644 --- a/drivers/s390/char/sclp_cpi.c +++ b/drivers/s390/char/sclp_cpi.c @@ -204,7 +204,7 @@ cpi_module_init(void) printk(KERN_WARNING "cpi: no control program identification " "support\n"); sclp_unregister(&sclp_cpi_event); - return -ENOTSUPP; + return -EOPNOTSUPP; } req = cpi_prepare_req(); diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c index 83f75774df6..56fa6916889 100644 --- a/drivers/s390/char/sclp_quiesce.c +++ b/drivers/s390/char/sclp_quiesce.c @@ -32,7 +32,7 @@ do_load_quiesce_psw(void * __unused) psw_t quiesce_psw; int cpu; - if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid)) + if (atomic_cmpxchg(&cpuid, -1, smp_processor_id()) != -1) signal_processor(smp_processor_id(), sigp_stop); /* Wait for all other cpus to enter stopped state */ for_each_online_cpu(cpu) { diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index a20d7c89341..6cbf067f1a8 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c @@ -13,6 +13,7 @@ #include <linux/kmod.h> #include <linux/tty.h> #include <linux/tty_driver.h> +#include <linux/tty_flip.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/slab.h> @@ -496,25 +497,19 @@ sclp_tty_input(unsigned char* buf, unsigned int count) case CTRLCHAR_SYSRQ: break; case CTRLCHAR_CTRL: - sclp_tty->flip.count++; - *sclp_tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *sclp_tty->flip.char_buf_ptr++ = cchar; + tty_insert_flip_char(sclp_tty, cchar, TTY_NORMAL); tty_flip_buffer_push(sclp_tty); break; case CTRLCHAR_NONE: /* send (normal) input to line discipline */ - memcpy(sclp_tty->flip.char_buf_ptr, buf, count); if (count < 2 || - (strncmp ((const char *) buf + count - 2, "^n", 2) && - strncmp ((const char *) buf + count - 2, "\0252n", 2))) { - sclp_tty->flip.char_buf_ptr[count] = '\n'; - count++; + (strncmp((const char *) buf + count - 2, "^n", 2) && + strncmp((const char *) buf + count - 2, "\252n", 2))) { + /* add the auto \n */ + tty_insert_flip_string(sclp_tty, buf, count); + tty_insert_flip_char(sclp_tty, '\n', TTY_NORMAL); } else - count -= 2; - memset(sclp_tty->flip.flag_buf_ptr, TTY_NORMAL, count); - sclp_tty->flip.char_buf_ptr += count; - sclp_tty->flip.flag_buf_ptr += count; - sclp_tty->flip.count += count; + tty_insert_flip_string(sclp_tty, buf, count - 2); tty_flip_buffer_push(sclp_tty); break; } diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 06bd85824d7..9e02625c82c 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -16,6 +16,7 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/tty_driver.h> +#include <linux/tty_flip.h> #include <linux/sched.h> #include <linux/errno.h> #include <linux/mm.h> @@ -482,16 +483,7 @@ sclp_vt220_receiver_fn(struct evbuf_header *evbuf) /* Send input to line discipline */ buffer++; count--; - /* Prevent buffer overrun by discarding input. Note that - * because buffer_push works asynchronously, we cannot wait - * for the buffer to be emptied. */ - if (count + sclp_vt220_tty->flip.count > TTY_FLIPBUF_SIZE) - count = TTY_FLIPBUF_SIZE - sclp_vt220_tty->flip.count; - memcpy(sclp_vt220_tty->flip.char_buf_ptr, buffer, count); - memset(sclp_vt220_tty->flip.flag_buf_ptr, TTY_NORMAL, count); - sclp_vt220_tty->flip.char_buf_ptr += count; - sclp_vt220_tty->flip.flag_buf_ptr += count; - sclp_vt220_tty->flip.count += count; + tty_insert_flip_string(sclp_vt220_tty, buffer, count); tty_flip_buffer_push(sclp_vt220_tty); break; } diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 1efc9f21229..5ced2725d6c 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c @@ -65,7 +65,7 @@ static void tapeblock_trigger_requeue(struct tape_device *device) { /* Protect against rescheduling. */ - if (atomic_compare_and_swap(0, 1, &device->blk_data.requeue_scheduled)) + if (atomic_cmpxchg(&device->blk_data.requeue_scheduled, 0, 1) != 0) return; schedule_work(&device->blk_data.requeue_task); } @@ -78,7 +78,7 @@ tapeblock_end_request(struct request *req, int uptodate) { if (end_that_request_first(req, uptodate, req->hard_nr_sectors)) BUG(); - end_that_request_last(req); + end_that_request_last(req, uptodate); } static void diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 86262a13f7c..5ce7ca38ace 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c @@ -37,6 +37,8 @@ static int tapechar_open(struct inode *,struct file *); static int tapechar_release(struct inode *,struct file *); static int tapechar_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +static long tapechar_compat_ioctl(struct file *, unsigned int, + unsigned long); static struct file_operations tape_fops = { @@ -44,6 +46,7 @@ static struct file_operations tape_fops = .read = tapechar_read, .write = tapechar_write, .ioctl = tapechar_ioctl, + .compat_ioctl = tapechar_compat_ioctl, .open = tapechar_open, .release = tapechar_release, }; @@ -463,6 +466,23 @@ tapechar_ioctl(struct inode *inp, struct file *filp, return device->discipline->ioctl_fn(device, no, data); } +static long +tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) +{ + struct tape_device *device = filp->private_data; + int rval = -ENOIOCTLCMD; + + if (device->discipline->ioctl_fn) { + lock_kernel(); + rval = device->discipline->ioctl_fn(device, no, data); + unlock_kernel(); + if (rval == -EINVAL) + rval = -ENOIOCTLCMD; + } + + return rval; +} + /* * Initialize character device frontend. */ diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c index 5473c23fcb5..5acc0ace3d7 100644 --- a/drivers/s390/char/vmwatchdog.c +++ b/drivers/s390/char/vmwatchdog.c @@ -66,7 +66,7 @@ static int __diag288(enum vmwdt_func func, unsigned int timeout, __cmdl = len; err = 0; asm volatile ( -#ifdef __s390x__ +#ifdef CONFIG_64BIT "diag %2,%4,0x288\n" "1: \n" ".section .fixup,\"ax\"\n" |