Re: Fix Me in hpet.c

From: H. Peter Anvin
Date: Thu Nov 20 2014 - 18:42:10 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/