lkml.org 
[lkml]   [2014]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fix Me in hpet.c
On 11/19/2014 06:58 PM, nick wrote:
> Greeting Thomas and other kernel coders,
> I am wondering about the fix in the code below and whether this is still valid as reading it seems to may no sense as
> we are using completion variables and therefore the delayed version of schedule_work_on seems much better in this
> case. Further more I am pasting the code below from vim in order to make it easier for you.
> Cheers Nick
> static int hpet_cpuhp_notify(struct notifier_block *n,
> unsigned long action, void *hcpu)
> {
> unsigned long cpu = (unsigned long)hcpu;
> struct hpet_work_struct work;
> struct hpet_dev *hdev = per_cpu(cpu_hpet_dev, cpu);
>
> switch (action & 0xf) {
> case CPU_ONLINE:
> INIT_DELAYED_WORK_ONSTACK(&work.work, hpet_work);
> init_completion(&work.complete);
> /* FIXME: add schedule_work_on() */
> schedule_delayed_work_on(cpu, &work.work, 0);
> wait_for_completion(&work.complete);
> destroy_delayed_work_on_stack(&work.work);
> break;
> case CPU_DEAD:
> if (hdev) {
> free_irq(hdev->irq, hdev);
> hdev->flags &= ~HPET_DEV_USED;
> per_cpu(cpu_hpet_dev, cpu) = NULL;
> }
> break;
> }
> return NOTIFY_OK;
> }
>

Looks obsolete to me. It might be interesting to look at the "git
blame" output for this code.

-hpa



\
 
 \ /
  Last update: 2014-11-21 01:21    [W:0.025 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site