lkml.org 
[lkml]   [2007]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH for review] [12/48] x86_64: use the global PIT lock
Date

> +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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-20 10:33    [W:2.144 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site