On Sun, May 21, 2017 at 07:57:53PM +0200, Thomas Gleixner wrote:
> On Thu, 18 May 2017, Christoph Hellwig wrote:
> > On Thu, May 18, 2017 at 10:24:48AM +0200, Christoph Hellwig wrote:
> > > > b) give the union a name (breaks any reference to timer_list->func in C
> > > > code):
> > > >
> > > > +
On Thu, 18 May 2017, Christoph Hellwig wrote:
> On Thu, May 18, 2017 at 10:24:48AM +0200, Christoph Hellwig wrote:
> > > b) give the union a name (breaks any reference to timer_list->func in C
> > > code):
> > >
> > > + union {
> > > + void(*func)(struct timer_li
On Sun, May 21, 2017 at 9:00 AM, Christoph Hellwig wrote:
> On Thu, May 18, 2017 at 10:57:31AM +0200, Arnd Bergmann wrote:
>> How expensive would it be to add another field to timer_list and
>> just have both pointers?
>
> That would add 4/8 bytes to every structure containing a timer,
> so I'd ra
On Thu, May 18, 2017 at 10:57:31AM +0200, Arnd Bergmann wrote:
> How expensive would it be to add another field to timer_list and
> just have both pointers?
That would add 4/8 bytes to every structure containing a timer,
so I'd rather avoid it if possible. But one option might be to
inflict this
On Fri, May 19, 2017 at 10:48:51AM +, David Laight wrote:
> From: Christoph Hellwig
> > Sent: 16 May 2017 12:48
> >
> > The new callback gets a pointer to the timer_list itself, which can
> > then be used to get the containing structure using container_of
> > instead of casting from and to unsi
From: Christoph Hellwig
> Sent: 16 May 2017 12:48
>
> The new callback gets a pointer to the timer_list itself, which can
> then be used to get the containing structure using container_of
> instead of casting from and to unsigned long all the time.
What about sensible drivers that put some other v
On Thu, May 18, 2017 at 10:41 AM, Christoph Hellwig wrote:
> On Thu, May 18, 2017 at 10:24:48AM +0200, Christoph Hellwig wrote:
>> > b) give the union a name (breaks any reference to timer_list->func in C
>> > code):
>> >
>> > + union {
>> > + void(*func)(struct
On Thu, May 18, 2017 at 10:24:48AM +0200, Christoph Hellwig wrote:
> > b) give the union a name (breaks any reference to timer_list->func in C
> > code):
> >
> > + union {
> > + void(*func)(struct timer_list *timer);
> > + void(*functio
> b) give the union a name (breaks any reference to timer_list->func in C code):
>
> + union {
> + void(*func)(struct timer_list *timer);
> + void(*function)(unsigned long);
> + } u;
I'll look into that, as it seems a lot safer,
On Tue, May 16, 2017 at 1:48 PM, Christoph Hellwig wrote:
> unsigned long expires;
> - void(*function)(unsigned long);
> + union {
> + void(*func)(struct timer_list *timer);
> + void(*function)(u
On 05/16/17 04:48, Christoph Hellwig wrote:
> diff --git a/include/linux/timer.h b/include/linux/timer.h
> index e6789b8757d5..87afe52c8349 100644
> --- a/include/linux/timer.h
> +++ b/include/linux/timer.h
\
> @@ -126,6 +146,32 @@ static inline void init_timer_on_stack_key(struct
The new callback gets a pointer to the timer_list itself, which can
then be used to get the containing structure using container_of
instead of casting from and to unsigned long all the time.
The setup helpers take a flags argument instead of needing countless
variants.
Note: this further reduces
12 matches
Mail list logo