[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2803da35e4de12ef2ca966a69052bf228f1cd10f.camel@redhat.com>
Date: Wed, 26 Nov 2025 10:33:51 +0100
From: Gabriele Monaco <gmonaco@...hat.com>
To: Nam Cao <namcao@...utronix.de>, Steven Rostedt <rostedt@...dmis.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, linux-trace-kernel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] rv: Convert to use lock guard
On Wed, 2025-11-26 at 09:36 +0100, Nam Cao wrote:
> On Tue, 2025-11-25 at 14:57 -0500, Steven Rostedt wrote:
> > On Mon, 17 Nov 2025 09:06:02 +0000
> > Nam Cao <namcao@...utronix.de> wrote:
> >
> > > @@ -644,13 +640,11 @@ static ssize_t enabled_monitors_write(struct file
> > > *filp, const char __user *user
> > > else
> > > retval = rv_disable_monitor(mon);
> > >
> > > - if (!retval)
> > > - retval = count;
> > > -
> > > - break;
> > > + if (retval)
> > > + return retval;
> > > + return count;
> >
> > No biggy, but I wonder if this would look better as:
> >
> > return retval ? : count;
>
> Unless you really prefer it this way, I would rather not. The first time
> I saw this syntax, it confused the hell out of me. Took me some time
> scratching my head until I figured out that it is a GNU extension.
>
> I prefer to stay with the C standard unless there is major benefit not
> to.
To be fair, I find it a bit obscure as well, although it's frequently used
within the kernel.
Let's not change it then.
Thanks,
Gabriele
Powered by blists - more mailing lists