lkml.org 
[lkml]   [2012]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/5] user_hooks: New user hooks subsystem
From
Date
On Mon, 2012-07-30 at 17:51 +0200, Frederic Weisbecker wrote:
> On Mon, Jul 30, 2012 at 05:08:12PM +0200, Peter Zijlstra wrote:
> > On Fri, 2012-07-27 at 17:40 +0200, Frederic Weisbecker wrote:
> > > +++ b/kernel/user_hooks.c
> > > @@ -0,0 +1,56 @@
> > > +#include <linux/user_hooks.h>
> > > +#include <linux/rcupdate.h>
> > > +#include <linux/sched.h>
> > > +#include <linux/percpu.h>
> > > +
> > > +struct user_hooks {
> > > + bool hooking;
> > > + bool in_user;
> > > +};
> >
> > I really detest using bool in structures.. but that's just me. Also this
> > really wants a comment as to wtf 'hooking' means. in_user I can just
> > about guess.
>
> I really don't mind changing that to int. I just like them as bool because
> they better describe the purpose of the field.

Not only does bool describe it better, it should also allow gcc to
optimize it better as well. Unless Peter has a legitimate rational why
using bool in struct is bad, I would keep it as is.

>
> hooking means that the hooks are set (the TIF flag is set on the current task
> and we also handle the exception hooks).
>
> I can call that is_hooking instead? And/or add a comment to explain the
> purpose of this.

Would 'is_hooked' be better? 'is_hooking' sounds more like what women in
high heels, really short skirts and lots of makeup are doing late night
on a corner of a Paris street ;-)

A comment to explain the purpose should be added regardless.

-- Steve




\
 
 \ /
  Last update: 2012-07-30 18:41    [W:0.085 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site