Skip to content

Commit

Permalink
Merge tag 'auxdisplay-for-linus-v5.12-rc6' of git://github.com/ojeda/…
Browse files Browse the repository at this point in the history
…linux

Pull auxdisplay fix from Miguel Ojeda:
 "Remove in_interrupt() usage (Sebastian Andrzej Siewior)"

* tag 'auxdisplay-for-linus-v5.12-rc6' of git://github.com/ojeda/linux:
  auxdisplay: Remove in_interrupt() usage.
  • Loading branch information
torvalds committed Mar 28, 2021
2 parents 36a1463 + 701454b commit 3fef15f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/auxdisplay/charlcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,14 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf,
char c;

for (; count-- > 0; (*ppos)++, tmp++) {
if (!in_interrupt() && (((count + 1) & 0x1f) == 0))
if (((count + 1) & 0x1f) == 0) {
/*
* let's be a little nice with other processes
* that need some CPU
* charlcd_write() is invoked as a VFS->write() callback
* and as such it is always invoked from preemptible
* context and may sleep.
*/
schedule();
cond_resched();
}

if (get_user(c, tmp))
return -EFAULT;
Expand Down Expand Up @@ -537,12 +539,8 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
int count = strlen(s);

for (; count-- > 0; tmp++) {
if (!in_interrupt() && (((count + 1) & 0x1f) == 0))
/*
* let's be a little nice with other processes
* that need some CPU
*/
schedule();
if (((count + 1) & 0x1f) == 0)
cond_resched();

charlcd_write_char(lcd, *tmp);
}
Expand Down

0 comments on commit 3fef15f

Please sign in to comment.