Skip to content

Commit b041267

Browse files
Ravishankargregkh
authored andcommitted
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>
1 parent cbecb8b commit b041267

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎drivers/staging/comedi/drivers/serial2002.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Status: in development
3838
#include <linux/sched.h>
3939
#include <linux/slab.h>
4040

41-
#include <asm/termios.h>
41+
#include <linux/termios.h>
4242
#include <asm/ioctls.h>
4343
#include <linux/serial.h>
4444
#include <linux/poll.h>
@@ -192,9 +192,8 @@ static int tty_read(struct file *f, int timeout)
192192
elapsed =
193193
(1000000 * (now.tv_sec - start.tv_sec) +
194194
now.tv_usec - start.tv_usec);
195-
if (elapsed > timeout) {
195+
if (elapsed > timeout)
196196
break;
197-
}
198197
set_current_state(TASK_INTERRUPTIBLE);
199198
schedule_timeout(((timeout -
200199
elapsed) * HZ) / 10000);
@@ -204,9 +203,8 @@ static int tty_read(struct file *f, int timeout)
204203
unsigned char ch;
205204

206205
f->f_pos = 0;
207-
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1) {
206+
if (f->f_op->read(f, &ch, 1, &f->f_pos) == 1)
208207
result = ch;
209-
}
210208
}
211209
} else {
212210
/* Device does not support poll, busy wait */
@@ -215,9 +213,8 @@ static int tty_read(struct file *f, int timeout)
215213
unsigned char ch;
216214

217215
retries++;
218-
if (retries >= timeout) {
216+
if (retries >= timeout)
219217
break;
220-
}
221218

222219
f->f_pos = 0;
223220
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)
329326

330327
length++;
331328
if (data < 0) {
332-
printk("serial2002 error\n");
329+
printk(KERN_ERR "serial2002 error\n");
333330
break;
334331
} else if (data & 0x80) {
335332
result.value = (result.value << 7) | (data & 0x7f);
@@ -402,7 +399,7 @@ static int serial_2002_open(struct comedi_device *dev)
402399
devpriv->tty = filp_open(port, O_RDWR, 0);
403400
if (IS_ERR(devpriv->tty)) {
404401
result = (int)PTR_ERR(devpriv->tty);
405-
printk("serial_2002: file open error = %d\n", result);
402+
printk(KERN_ERR "serial_2002: file open error = %d\n", result);
406403
} else {
407404
struct config_t {
408405

0 commit comments

Comments
 (0)