[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707201025.12915.ak@suse.de>
Date: Fri, 20 Jul 2007 10:25:12 +0200
From: Andi Kleen <ak@...e.de>
To: Dmitry Torokhov <dtor@...ightbb.com>
Cc: tglx@...utronix.de, mingo@...e.hu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH for review] [12/48] x86_64: use the global PIT lock
> +static DEFINE_SPINLOCK(i8253_lock);
> +
> static __init int add_pcspkr(void)
> {
> struct platform_device *pd;
> @@ -1501,9 +1503,14 @@ static __init int add_pcspkr(void)
> if (!pd)
> return -ENOMEM;
>
> + pd->dev.platform_data = &i8253_lock;
That seems pretty ugly to pass spinlocks around in void * pointers. Also
out of general memory bloat reasons i don't like allocating big data structures
just for this.
Wouldn't it be better to just define i8253_lock weakly in the pcspkr code and let
the architecture override it?
> Index: work/arch/x86_64/kernel/time.c
> ===================================================================
> --- work.orig/arch/x86_64/kernel/time.c
> +++ work/arch/x86_64/kernel/time.c
> @@ -23,6 +23,7 @@
> #include <linux/module.h>
> #include <linux/device.h>
> #include <linux/sysdev.h>
> +#include <linux/platform_device.h>
> #include <linux/bcd.h>
> #include <linux/notifier.h>
> #include <linux/cpu.h>
> @@ -185,7 +186,7 @@ void main_timer_handler(void)
> set_rtc_mmss(xtime.tv_sec);
> rtc_update = xtime.tv_sec + 660;
> }
> -
> +
> write_sequnlock(&xtime_lock);
> }
No random white space changes in patches, multiple occurrences ?!?
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists