Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-04 Thread Christoph Hellwig
On Sun, Sep 03, 2017 at 01:18:44PM -0700, Kees Cook wrote: > It feels weird to have different semantics from container_of() too, so > I'll probably just switch everything around to be like all the others, > in that they are just direct wrappers around container_of()... I'll > settle on something

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-04 Thread Christoph Hellwig
On Sun, Sep 03, 2017 at 01:18:44PM -0700, Kees Cook wrote: > It feels weird to have different semantics from container_of() too, so > I'll probably just switch everything around to be like all the others, > in that they are just direct wrappers around container_of()... I'll > settle on something

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-03 Thread Kees Cook
On Sun, Sep 3, 2017 at 12:37 AM, Christoph Hellwig wrote: > On Fri, Sep 01, 2017 at 09:24:22AM -0700, Kees Cook wrote: >> #define list_entry(ptr, type, member) container_of(ptr, type, member) >> #define rb_entry(ptr, type, member) container_of(ptr, type, member) >> >> The use

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-03 Thread Kees Cook
On Sun, Sep 3, 2017 at 12:37 AM, Christoph Hellwig wrote: > On Fri, Sep 01, 2017 at 09:24:22AM -0700, Kees Cook wrote: >> #define list_entry(ptr, type, member) container_of(ptr, type, member) >> #define rb_entry(ptr, type, member) container_of(ptr, type, member) >> >> The use of a "timer_entry()"

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-03 Thread Christoph Hellwig
On Fri, Sep 01, 2017 at 09:24:22AM -0700, Kees Cook wrote: > #define list_entry(ptr, type, member) container_of(ptr, type, member) > #define rb_entry(ptr, type, member) container_of(ptr, type, member) > > The use of a "timer_entry()" at the start of callbacks repeats the > struct name, which I

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-03 Thread Christoph Hellwig
On Fri, Sep 01, 2017 at 09:24:22AM -0700, Kees Cook wrote: > #define list_entry(ptr, type, member) container_of(ptr, type, member) > #define rb_entry(ptr, type, member) container_of(ptr, type, member) > > The use of a "timer_entry()" at the start of callbacks repeats the > struct name, which I

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Kees Cook
On Fri, Sep 1, 2017 at 3:44 AM, Christoph Hellwig wrote: > On Fri, Sep 01, 2017 at 12:21:46PM +0200, Thomas Gleixner wrote: >> On Fri, 1 Sep 2017, Christoph Hellwig wrote: >> >> > Good work! >> > >> > I just think that the TIMER_CONTAINER name is revolting. >> > >> > The usual

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Kees Cook
On Fri, Sep 1, 2017 at 3:44 AM, Christoph Hellwig wrote: > On Fri, Sep 01, 2017 at 12:21:46PM +0200, Thomas Gleixner wrote: >> On Fri, 1 Sep 2017, Christoph Hellwig wrote: >> >> > Good work! >> > >> > I just think that the TIMER_CONTAINER name is revolting. >> > >> > The usual name for such a

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Christoph Hellwig
On Fri, Sep 01, 2017 at 12:21:46PM +0200, Thomas Gleixner wrote: > On Fri, 1 Sep 2017, Christoph Hellwig wrote: > > > Good work! > > > > I just think that the TIMER_CONTAINER name is revolting. > > > > The usual name for such a helper fitting other uses like lists > > and rbtrees would be

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Christoph Hellwig
On Fri, Sep 01, 2017 at 12:21:46PM +0200, Thomas Gleixner wrote: > On Fri, 1 Sep 2017, Christoph Hellwig wrote: > > > Good work! > > > > I just think that the TIMER_CONTAINER name is revolting. > > > > The usual name for such a helper fitting other uses like lists > > and rbtrees would be

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Thomas Gleixner
On Fri, 1 Sep 2017, Christoph Hellwig wrote: > Good work! > > I just think that the TIMER_CONTAINER name is revolting. > > The usual name for such a helper fitting other uses like lists > and rbtrees would be timer_entry, and that also reads much better. I think the plan is to remove that

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Thomas Gleixner
On Fri, 1 Sep 2017, Christoph Hellwig wrote: > Good work! > > I just think that the TIMER_CONTAINER name is revolting. > > The usual name for such a helper fitting other uses like lists > and rbtrees would be timer_entry, and that also reads much better. I think the plan is to remove that

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Christoph Hellwig
Good work! I just think that the TIMER_CONTAINER name is revolting. The usual name for such a helper fitting other uses like lists and rbtrees would be timer_entry, and that also reads much better.

Re: Converting struct timer_list callback argument to struct timer_list *

2017-09-01 Thread Christoph Hellwig
Good work! I just think that the TIMER_CONTAINER name is revolting. The usual name for such a helper fitting other uses like lists and rbtrees would be timer_entry, and that also reads much better.

Re: Converting struct timer_list callback argument to struct timer_list *

2017-08-31 Thread Kees Cook
On Thu, Aug 31, 2017 at 1:13 PM, Thomas Gleixner wrote: > On Wed, 30 Aug 2017, Kees Cook wrote: >> Which gets me to here: >> 747 files changed, 3363 insertions(+), 3410 deletions(-) >> >> And current builds with the forced casts removed show about 400 more >> call sites to

Re: Converting struct timer_list callback argument to struct timer_list *

2017-08-31 Thread Kees Cook
On Thu, Aug 31, 2017 at 1:13 PM, Thomas Gleixner wrote: > On Wed, 30 Aug 2017, Kees Cook wrote: >> Which gets me to here: >> 747 files changed, 3363 insertions(+), 3410 deletions(-) >> >> And current builds with the forced casts removed show about 400 more >> call sites to fix... > > That's a

Re: Converting struct timer_list callback argument to struct timer_list *

2017-08-31 Thread Thomas Gleixner
On Wed, 30 Aug 2017, Kees Cook wrote: > Which gets me to here: > 747 files changed, 3363 insertions(+), 3410 deletions(-) > > And current builds with the forced casts removed show about 400 more > call sites to fix... That's a herculean task. Chapeau! > Does this look alright, Very well done.

Re: Converting struct timer_list callback argument to struct timer_list *

2017-08-31 Thread Thomas Gleixner
On Wed, 30 Aug 2017, Kees Cook wrote: > Which gets me to here: > 747 files changed, 3363 insertions(+), 3410 deletions(-) > > And current builds with the forced casts removed show about 400 more > call sites to fix... That's a herculean task. Chapeau! > Does this look alright, Very well done.

Converting struct timer_list callback argument to struct timer_list *

2017-08-30 Thread Kees Cook
Hi, I'm working on converting all callbacks of struct timer_list into taking the struct timer_list * that triggered the callback (instead of the timer_list.data field), as done for hrtimers, work queues, etc. Doing this has a number of benefits including actual type checking (via container_of(),

Converting struct timer_list callback argument to struct timer_list *

2017-08-30 Thread Kees Cook
Hi, I'm working on converting all callbacks of struct timer_list into taking the struct timer_list * that triggered the callback (instead of the timer_list.data field), as done for hrtimers, work queues, etc. Doing this has a number of benefits including actual type checking (via container_of(),