Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34389
b: refs/heads/master
c: 4ac493b
h: refs/heads/master
i:
  34387: 14017d4
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 23, 2006
1 parent 74acb4b commit ecf38b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2efc80cb8ddc341d81de996920e3b2ad8a12b1f7
refs/heads/master: 4ac493b1d5bfd332f3dee64baaa620961bab6cdc
17 changes: 10 additions & 7 deletions trunk/drivers/char/briq_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int briq_panel_release(struct inode *ino, struct file *filep)
return 0;
}

static ssize_t briq_panel_read(struct file *file, char *buf, size_t count,
static ssize_t briq_panel_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos)
{
unsigned short c;
Expand Down Expand Up @@ -135,7 +135,7 @@ static void scroll_vfd( void )
vfd_cursor = 20;
}

static ssize_t briq_panel_write(struct file *file, const char *buf, size_t len,
static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_t len,
loff_t *ppos)
{
size_t indx = len;
Expand All @@ -150,19 +150,22 @@ static ssize_t briq_panel_write(struct file *file, const char *buf, size_t len,
return -EBUSY;

for (;;) {
char c;
if (!indx)
break;
if (get_user(c, buf))
return -EFAULT;
if (esc) {
set_led(*buf);
set_led(c);
esc = 0;
} else if (*buf == 27) {
} else if (c == 27) {
esc = 1;
} else if (*buf == 12) {
} else if (c == 12) {
/* do a form feed */
for (i=0; i<40; i++)
vfd[i] = ' ';
vfd_cursor = 0;
} else if (*buf == 10) {
} else if (c == 10) {
if (vfd_cursor < 20)
vfd_cursor = 20;
else if (vfd_cursor < 40)
Expand All @@ -175,7 +178,7 @@ static ssize_t briq_panel_write(struct file *file, const char *buf, size_t len,
/* just a character */
if (vfd_cursor > 39)
scroll_vfd();
vfd[vfd_cursor++] = *buf;
vfd[vfd_cursor++] = c;
}
indx--;
buf++;
Expand Down

0 comments on commit ecf38b3

Please sign in to comment.