drivers: Push down BKL into various drivers
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 57 lines · Linux Kernel Mailing List
drivers/input/misc/hp_sdc_rtc.c +17
-10@@ -43,6 +43,7 @@ #include <linux/proc_fs.h> #include <linux/poll.h> #include <linux/rtc.h> +#include <linux/smp_lock.h> #include <linux/semaphore.h> MODULE_AUTHOR("Brian S. Julin <[email protected]>");@@ -64,8 +65,8 @@ static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait); static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos); -static int hp_sdc_rtc_ioctl (struct inode *inode,struct file *file, - unsigned int cmd, unsigned long arg); +static long hp_sdc_rtc_unlocked_ioctl (struct file *file, + unsigned int cmd, unsigned long arg); static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);@@ -512,7 +513,7 @@ static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off, return len; } -static int hp_sdc_rtc_ioctl (struct inode *inode,struct file *file, +static int hp_sdc_rtc_ioctl (struct file *file, unsigned int cmd, unsigned long arg) { #if 1@@ -659,14 +660,27 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, #endif } +static long hp_sdc_rtc_unlocked_ioctl (struct file *file, + unsigned int cmd, unsigned long arg) +{ + int ret; + + lock_kernel(); + ret = hp_sdc_rtc_ioctl(file, cmd, arg); + unlock_kernel(); + + return ret; +} + + static const struct file_operations hp_sdc_rtc_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .read = hp_sdc_rtc_read, - .poll = hp_sdc_rtc_poll, - .ioctl = hp_sdc_rtc_ioctl, - .open = hp_sdc_rtc_open, - .fasync = hp_sdc_rtc_fasync,
drivers/input/misc/hp_sdc_rtc.c static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, · line 686
Quoted 10 lines
drivers/input/misc/hp_sdc_rtc.c +7
-0+ .owner = THIS_MODULE, + .llseek = no_llseek, + .read = hp_sdc_rtc_read, + .poll = hp_sdc_rtc_poll, + .unlocked_ioctl = hp_sdc_rtc_ioctl, + .open = hp_sdc_rtc_open, + .fasync = hp_sdc_rtc_fasync, }; static struct miscdevice hp_sdc_rtc_dev = {
Something went wrong with this one:
| drivers/input/misc/hp_sdc_rtc.c:681: warning: initialization from incompatible pointer type
| drivers/input/misc/hp_sdc_rtc.c:665: warning:
‘hp_sdc_rtc_unlocked_ioctl’ defined but not used
(detected while debugging my script to find compiler warning regressions)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
hp_sdc_rtc: fix broken ioctl conversion
Commit 55929332c92 "drivers: Push down BKL into various drivers" introduced a regression in hp_sdc_rtc, caused by a missing change of the .unlocked_ioctl pointer to the newly introduced function.
Quoted 6 lines · Geert Uytterhoeven
Something went wrong with this one:
|
drivers/input/misc/hp_sdc_rtc.c:681: warning: initialization from incompatible pointer type
|drivers/input/misc/hp_sdc_rtc.c:665: warning:
‘hp_sdc_rtc_unlocked_ioctl’ defined but not used
drivers/input/misc/hp_sdc_rtc.c +1 -1
@@ -678,7 +678,7 @@ static const struct file_operations hp_sdc_rtc_fops = { .llseek = no_llseek, .read = hp_sdc_rtc_read, .poll = hp_sdc_rtc_poll, - .unlocked_ioctl = hp_sdc_rtc_ioctl, + .unlocked_ioctl = hp_sdc_rtc_unlocked_ioctl, .open = hp_sdc_rtc_open, .fasync = hp_sdc_rtc_fasync, };
Frederic Weisbecker
AppliedRe: hp_sdc_rtc: fix broken ioctl conversion
Quoted 20 lines · Arnd Bergmann
Commit
55929332c92"drivers: Push down BKL into various drivers" introduced a regression inhp_sdc_rtc, caused by a missing change of the .unlocked_ioctl pointer to the newly introduced function.Quoted 6 lines · Geert Uytterhoeven
Something went wrong with this one:
|
drivers/input/misc/hp_sdc_rtc.c:681: warning: initialization from incompatible pointer type
|drivers/input/misc/hp_sdc_rtc.c:665: warning:
‘hp_sdc_rtc_unlocked_ioctl’ defined but not usedSigned-off-by Arnd Bergmann <[email protected]>drivers/input/misc/hp_sdc_rtc.c +0
-0
drivers/input/misc/hp_sdc_rtc.c static const struct file_operations hp_sdc_rtc_fops = { · line 684
Quoted 8 lines
drivers/input/misc/hp_sdc_rtc.c +1
-1@@ -678,7 +678,7 @@ static const struct file_operations hp_sdc_rtc_fops = { .llseek = no_llseek, .read = hp_sdc_rtc_read, .poll = hp_sdc_rtc_poll, - .unlocked_ioctl = hp_sdc_rtc_ioctl, + .unlocked_ioctl = hp_sdc_rtc_unlocked_ioctl, .open = hp_sdc_rtc_open, .fasync = hp_sdc_rtc_fasync, };
Queued for .35, thanks!
Geert Uytterhoeven
Acked-byRe: hp_sdc_rtc: fix broken ioctl conversion
In reply to Arnd BergmannQuoted 6 lines · Arnd Bergmann
Commit
55929332c92"drivers: Push down BKL into various drivers" introduced a regression inhp_sdc_rtc, caused by a missing change of the .unlocked_ioctl pointer to the newly introduced function.On Saturday 05 June 2010, Geert Uytterhoeven wrote:
Quoted 8 lines
Quoted 6 lines
Something went wrong with this one:
|
drivers/input/misc/hp_sdc_rtc.c:681: warning: initialization from incompatible pointer type
|drivers/input/misc/hp_sdc_rtc.c:665: warning:
‘hp_sdc_rtc_unlocked_ioctl’ defined but not usedSigned-off-by Arnd Bergmann <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds