* [PATCH] zorro: BKL removal
@ 2010-06-05 19:23 Geert Uytterhoeven
2010-06-05 19:41 ` Frederic Weisbecker
2010-06-05 19:53 ` Arnd Bergmann
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2010-06-05 19:23 UTC (permalink / raw)
To: Linux/m68k, Arnd Bergmann; +Cc: Linux Kernel Development
Remove BKL use from proc_bus_zorro_lseek(), like was done for
proc_bus_pci_lseek() a long time ago.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/zorro/proc.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 3c7046d..4f4ea88 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -22,8 +22,9 @@ static loff_t
proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
{
loff_t new = -1;
+ struct inode *inode = file->f_path.dentry->d_inode;
- lock_kernel();
+ mutex_lock(&inode->i_mutex);
switch (whence) {
case 0:
new = off;
@@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
new = sizeof(struct ConfigDev) + off;
break;
}
- if (new < 0 || new > sizeof(struct ConfigDev)) {
- unlock_kernel();
- return -EINVAL;
- }
- unlock_kernel();
- return (file->f_pos = new);
+ if (new < 0 || new > sizeof(struct ConfigDev))
+ new = -EINVAL;
+ else
+ file->f_pos = new;
+ mutex_unlock(&inode->i_mutex);
+ return new;
}
static ssize_t
--
1.7.0.4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] zorro: BKL removal
2010-06-05 19:23 [PATCH] zorro: BKL removal Geert Uytterhoeven
@ 2010-06-05 19:41 ` Frederic Weisbecker
2010-06-05 20:03 ` Geert Uytterhoeven
2010-06-05 19:53 ` Arnd Bergmann
1 sibling, 1 reply; 5+ messages in thread
From: Frederic Weisbecker @ 2010-06-05 19:41 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k, Arnd Bergmann, Linux Kernel Development
On Sat, Jun 05, 2010 at 09:23:01PM +0200, Geert Uytterhoeven wrote:
> Remove BKL use from proc_bus_zorro_lseek(), like was done for
> proc_bus_pci_lseek() a long time ago.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
Cool.
I suspect you'll queue it in your tree? Or should I?
Thanks.
> drivers/zorro/proc.c | 15 ++++++++-------
> 1 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
> index 3c7046d..4f4ea88 100644
> --- a/drivers/zorro/proc.c
> +++ b/drivers/zorro/proc.c
> @@ -22,8 +22,9 @@ static loff_t
> proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
> {
> loff_t new = -1;
> + struct inode *inode = file->f_path.dentry->d_inode;
>
> - lock_kernel();
> + mutex_lock(&inode->i_mutex);
> switch (whence) {
> case 0:
> new = off;
> @@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
> new = sizeof(struct ConfigDev) + off;
> break;
> }
> - if (new < 0 || new > sizeof(struct ConfigDev)) {
> - unlock_kernel();
> - return -EINVAL;
> - }
> - unlock_kernel();
> - return (file->f_pos = new);
> + if (new < 0 || new > sizeof(struct ConfigDev))
> + new = -EINVAL;
> + else
> + file->f_pos = new;
> + mutex_unlock(&inode->i_mutex);
> + return new;
> }
>
> static ssize_t
> --
> 1.7.0.4
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zorro: BKL removal
2010-06-05 19:23 [PATCH] zorro: BKL removal Geert Uytterhoeven
2010-06-05 19:41 ` Frederic Weisbecker
@ 2010-06-05 19:53 ` Arnd Bergmann
1 sibling, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2010-06-05 19:53 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k, Linux Kernel Development
On Saturday 05 June 2010, Geert Uytterhoeven wrote:
> Remove BKL use from proc_bus_zorro_lseek(), like was done for
> proc_bus_pci_lseek() a long time ago.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zorro: BKL removal
2010-06-05 19:41 ` Frederic Weisbecker
@ 2010-06-05 20:03 ` Geert Uytterhoeven
2010-06-05 20:39 ` Frederic Weisbecker
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2010-06-05 20:03 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Linux/m68k, Arnd Bergmann, Linux Kernel Development
On Sat, Jun 5, 2010 at 21:41, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> On Sat, Jun 05, 2010 at 09:23:01PM +0200, Geert Uytterhoeven wrote:
>> Remove BKL use from proc_bus_zorro_lseek(), like was done for
>> proc_bus_pci_lseek() a long time ago.
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
> Cool.
>
> I suspect you'll queue it in your tree? Or should I?
I'll queue it for 2.6.36.
But I don't mind you to take it if you want to do something earlier...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zorro: BKL removal
2010-06-05 20:03 ` Geert Uytterhoeven
@ 2010-06-05 20:39 ` Frederic Weisbecker
0 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2010-06-05 20:39 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k, Arnd Bergmann, Linux Kernel Development
On Sat, Jun 05, 2010 at 10:03:33PM +0200, Geert Uytterhoeven wrote:
> On Sat, Jun 5, 2010 at 21:41, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > On Sat, Jun 05, 2010 at 09:23:01PM +0200, Geert Uytterhoeven wrote:
> >> Remove BKL use from proc_bus_zorro_lseek(), like was done for
> >> proc_bus_pci_lseek() a long time ago.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >> ---
> > Cool.
> >
> > I suspect you'll queue it in your tree? Or should I?
>
> I'll queue it for 2.6.36.
>
> But I don't mind you to take it if you want to do something earlier...
It's ok you can take it. I prefer that maintainers take these
bkl works when possible, as they better know the code.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-05 20:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-05 19:23 [PATCH] zorro: BKL removal Geert Uytterhoeven
2010-06-05 19:41 ` Frederic Weisbecker
2010-06-05 20:03 ` Geert Uytterhoeven
2010-06-05 20:39 ` Frederic Weisbecker
2010-06-05 19:53 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox