Re: [PATCH] introduce setup_timer() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arjan van de Ven wrote:
> 
> >                               unsigned long data)
> > +{
> > +     timer->function = function;
> > +     timer->data = data;
> > +     init_timer(timer);
> > +}
> 
> are you sure you want to do this in this order???
> I'd expect the init_timer to be first...

I think it does not matter from correctness point of view.

But if we have:

	setup_timer(timer, expr1(), expr2())

it is better to initialize ->func and ->data first, otherwise
the compiler should save the results from expr{1,2}, then call
init_timer(), then copy these results to *timer.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux