Re: [PATCH 1/2] cleanup: Add conditional guard support

From: Oleg Nesterov
Date: Fri Nov 03 2023 - 14:53:45 EST


On 11/03, Linus Torvalds wrote:
>
> On Thu, 2 Nov 2023 at 23:30, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > Linus, do you like that enough to suffer a flag day patch as proposed by
> > Oleg?
>
> I don't find myself caring too much whether we have that "double
> grouping" of the guard type-vs-arguments or the "(type, arg...)"
> syntax.

Neither me,

> I honestly think that "guard(spinlock)(&lock)" makes it more visually
> obvious that the first argument is the "type of guard", while
> "guard(spinlock, &lock)" makes it look like the two arguments are
> somehow at the same level, which they most definitely aren't.

My point was that

guard(spinlock)(&lock);

doesn't match

scoped_guard(spinlock, &lock);

but I agree this purely cosmetic, so lets forget it.

Oleg.