Skip to contentSkip to conversation

x86, hpet.c: Changed type of field work of hpet_work_struct (delayed_work to work_struct)

PATCH In review Leonardo de Sá Alt 2 participants 2 messages Jun 16, 2010 – Jun 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, hpet.c: Changed type of field work of hpet_work_struct (delayed_work to work_struct)

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.

---
 arch/x86/kernel/hpet.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
arch/x86/kernel/hpet.c +4 -6
index a198b7c..b05935f 100644
@@ -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) {
Signature · 1 line
1.6.3.3
Acked-by on v1 1/1
#1 lore raw

Looks good.

Quoted 56 lines · Leonardo de Sá Alt

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.

---
 arch/x86/kernel/hpet.c |   10 ++++------

 1 files changed, 4 insertions(+), 6 deletions(-)
arch/x86/kernel/hpet.c +2 -2
index a198b7c..b05935f 100644
@@ -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