Staging: comedi: fix brace and printk coding style issue in serial2002.c
This is a patch to the serial2002.c file that fixes up a brace and printk warning found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cbecb8bf56
commit
b041267ea8
@ -38,7 +38,7 @@ Status: in development
|
|||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <asm/termios.h>
|
#include <linux/termios.h>
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
@ -192,9 +192,8 @@ static int tty_read(struct file *f, int timeout)
|
|||||||
elapsed =
|
elapsed =
|
||||||
(1000000 * (now.tv_sec - start.tv_sec) +
|
(1000000 * (now.tv_sec - start.tv_sec) +
|
||||||
now.tv_usec - start.tv_usec);
|
now.tv_usec - start.tv_usec);
|
||||||
if (elapsed > timeout) {
|
if (elapsed > timeout)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
schedule_timeout(((timeout -
|
schedule_timeout(((timeout -
|
||||||
elapsed) * HZ) / 10000);
|
elapsed) * HZ) / 10000);
|
||||||
@ -204,9 +203,8 @@ static int tty_read(struct file *f, int timeout)
|
|||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
|
|
||||||
f->f_pos = 0;
|
f->f_pos = 0;
|
||||||
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1) {
|
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1)
|
||||||
result = ch;
|
result = ch;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Device does not support poll, busy wait */
|
/* Device does not support poll, busy wait */
|
||||||
@ -215,9 +213,8 @@ static int tty_read(struct file *f, int timeout)
|
|||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
|
|
||||||
retries++;
|
retries++;
|
||||||
if (retries >= timeout) {
|
if (retries >= timeout)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
f->f_pos = 0;
|
f->f_pos = 0;
|
||||||
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1) {
|
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1) {
|
||||||
@ -329,7 +326,7 @@ static struct serial_data serial_read(struct file *f, int timeout)
|
|||||||
|
|
||||||
length++;
|
length++;
|
||||||
if (data < 0) {
|
if (data < 0) {
|
||||||
printk("serial2002 error\n");
|
printk(KERN_ERR "serial2002 error\n");
|
||||||
break;
|
break;
|
||||||
} else if (data & 0x80) {
|
} else if (data & 0x80) {
|
||||||
result.value = (result.value << 7) | (data & 0x7f);
|
result.value = (result.value << 7) | (data & 0x7f);
|
||||||
@ -402,7 +399,7 @@ static int serial_2002_open(struct comedi_device *dev)
|
|||||||
devpriv->tty = filp_open(port, O_RDWR, 0);
|
devpriv->tty = filp_open(port, O_RDWR, 0);
|
||||||
if (IS_ERR(devpriv->tty)) {
|
if (IS_ERR(devpriv->tty)) {
|
||||||
result = (int)PTR_ERR(devpriv->tty);
|
result = (int)PTR_ERR(devpriv->tty);
|
||||||
printk("serial_2002: file open error = %d\n", result);
|
printk(KERN_ERR "serial_2002: file open error = %d\n", result);
|
||||||
} else {
|
} else {
|
||||||
struct config_t {
|
struct config_t {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user