Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface

From: Steven Rostedt
Date: Tue Aug 04 2015 - 08:06:59 EST


On Tue, 4 Aug 2015 05:37:33 +0200
Borislav Petkov <bp@xxxxxxxxx> wrote:

> On Mon, Aug 03, 2015 at 05:57:57PM -0400, Steven Rostedt wrote:
> > That's implementation details, not a general concept that users will
> > need to know about.
>
> Why?
>
> It is a branch, regardless of which insn is used on which arch - it is
> either active and you *branch* to that code or *inactive* and you don't.
> So now it is actually what it should've been from the beginning...

I just don't like the inconsistency of the initialization and the
setting.

Either have:

DEFINE_STATIC_KEY_TRUE()
DEFINE_STATIC_KEY_FALSE()

and

static_branch_set_true()
static_branch_set_false()


or have:

DEFINE_STATIC_KEY_ENABLED()
DEFINE_STATIC_KEY_DISABLED()

and

static_branch_enable()
static_branch_disable()


But having the DEFINE_STATIC_KEY_TRUE() and static_branch_enable() is
confusing, as enable does not mean "make true"!

This may seem as bike shedding, but terminology *is* important, and
being inconsistent just makes it more probable to have bugs.

-- Steve

>
> I realize simplifying the terminology around those jump labels/static
> branches things comes kinda unnatural now.
>

--
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/