mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86, hpet.c: Changed type of field work of hpet_work_struct (delayed_work to work_struct)
@ 2010-06-16 14:55 Leonardo de Sá Alt
  2010-06-19  0:45 ` Venkatesh Pallipadi
  0 siblings, 1 reply; 2+ messages in thread
From: Leonardo de Sá Alt @ 2010-06-16 14:55 UTC (permalink / raw)
  To: venki; +Cc: mingo, linux-kernel, leonardoaltt

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

Hi Venki,
here the new patch with the changes you requested.

Thanks.

The hpet_work_struct has a delayed_work (field work), but it doesn't use 
delay. So this field type was changed for work_struct, and its utilizations
as delayed_work were adapted to work_struct.

Signed-off-by: Leonardo de Sá Alt <leonardoaltt@gmail.com>

---
 arch/x86/kernel/hpet.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index a198b7c..b05935f 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -696,7 +696,7 @@ static struct hpet_dev *hpet_get_unused_timer(void)
 }
 
 struct hpet_work_struct {
-	struct delayed_work work;
+	struct work_struct work;
 	struct completion complete;
 };
 
@@ -706,7 +706,7 @@ static void hpet_work(struct work_struct *w)
 	int cpu = smp_processor_id();
 	struct hpet_work_struct *hpet_work;
 
-	hpet_work = container_of(w, struct hpet_work_struct, work.work);
+	hpet_work = container_of(w, struct hpet_work_struct, work);
 
 	hdev = hpet_get_unused_timer();
 	if (hdev)
@@ -724,12 +724,10 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
 
 	switch (action & 0xf) {
 	case CPU_ONLINE:
-		INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
+		INIT_WORK_ON_STACK(&work.work, hpet_work);
 		init_completion(&work.complete);
-		/* FIXME: add schedule_work_on() */
-		schedule_delayed_work_on(cpu, &work.work, 0);
+		schedule_work_on(cpu, &work.work);
 		wait_for_completion(&work.complete);
-		destroy_timer_on_stack(&work.work.timer);
 		break;
 	case CPU_DEAD:
 		if (hdev) {
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86, hpet.c: Changed type of field work of  hpet_work_struct (delayed_work to work_struct)
  2010-06-16 14:55 [PATCH] x86, hpet.c: Changed type of field work of hpet_work_struct (delayed_work to work_struct) Leonardo de Sá Alt
@ 2010-06-19  0:45 ` Venkatesh Pallipadi
  0 siblings, 0 replies; 2+ messages in thread
From: Venkatesh Pallipadi @ 2010-06-19  0:45 UTC (permalink / raw)
  To: Leonardo de Sá Alt
  Cc: mingo, linux-kernel, Thomas Gleixner, H. Peter Anvin

Looks good.

Acked-by: Venkatesh Pallipadi <venki@google.com>

On Wed, Jun 16, 2010 at 7:55 AM, Leonardo de Sá Alt
<leonardoaltt@gmail.com> wrote:
> Hi Venki,
> here the new patch with the changes you requested.
>
> Thanks.
>
> The hpet_work_struct has a delayed_work (field work), but it doesn't use
> delay. So this field type was changed for work_struct, and its utilizations
> as delayed_work were adapted to work_struct.
>
> Signed-off-by: Leonardo de Sá Alt <leonardoaltt@gmail.com>
>
> ---
>  arch/x86/kernel/hpet.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
> index a198b7c..b05935f 100644
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -696,7 +696,7 @@ static struct hpet_dev *hpet_get_unused_timer(void)
>  }
>
>  struct hpet_work_struct {
> -       struct delayed_work work;
> +       struct work_struct work;
>        struct completion complete;
>  };
>
> @@ -706,7 +706,7 @@ static void hpet_work(struct work_struct *w)
>        int cpu = smp_processor_id();
>        struct hpet_work_struct *hpet_work;
>
> -       hpet_work = container_of(w, struct hpet_work_struct, work.work);
> +       hpet_work = container_of(w, struct hpet_work_struct, work);
>
>        hdev = hpet_get_unused_timer();
>        if (hdev)
> @@ -724,12 +724,10 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
>
>        switch (action & 0xf) {
>        case CPU_ONLINE:
> -               INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
> +               INIT_WORK_ON_STACK(&work.work, hpet_work);
>                init_completion(&work.complete);
> -               /* FIXME: add schedule_work_on() */
> -               schedule_delayed_work_on(cpu, &work.work, 0);
> +               schedule_work_on(cpu, &work.work);
>                wait_for_completion(&work.complete);
> -               destroy_timer_on_stack(&work.work.timer);
>                break;
>        case CPU_DEAD:
>                if (hdev) {
> --
> 1.6.3.3
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-19  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-16 14:55 [PATCH] x86, hpet.c: Changed type of field work of hpet_work_struct (delayed_work to work_struct) Leonardo de Sá Alt
2010-06-19  0:45 ` Venkatesh Pallipadi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®