From: Nam Cao <namcao@linutronix.de>
To: Gabriele Monaco <gmonaco@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] rv: Convert to use lock guard
Date: Wed, 26 Nov 2025 09:36:23 +0100 [thread overview]
Message-ID: <878qft5gxk.fsf@yellow.woof> (raw)
In-Reply-To: <e4838dd91f14024222eef8e705f2b1ae7945bb80.camel@redhat.com>
On Tue, 2025-11-25 at 14:57 -0500, Steven Rostedt wrote:
> On Mon, 17 Nov 2025 09:06:02 +0000
> Nam Cao <namcao@linutronix.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.
Nam
next prev parent reply other threads:[~2025-11-26 8:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 9:06 [PATCH v2 0/2] rv: Tidy up with auto-cleanup Nam Cao
2025-11-17 9:06 ` [PATCH v2 1/2] rv: Convert to use lock guard Nam Cao
2025-11-25 19:57 ` Steven Rostedt
2025-11-26 7:27 ` Gabriele Monaco
2025-11-26 8:36 ` Nam Cao [this message]
2025-11-26 9:33 ` Gabriele Monaco
2025-11-26 15:42 ` Steven Rostedt
2025-11-26 14:51 ` Steven Rostedt
2025-11-26 15:22 ` Gabriele Monaco
2025-12-01 15:24 ` Steven Rostedt
2025-12-01 15:28 ` Gabriele Monaco
2025-12-02 1:38 ` Steven Rostedt
2025-12-02 1:51 ` Steven Rostedt
2025-12-02 6:41 ` Gabriele Monaco
2025-12-01 15:28 ` Nam Cao
2025-11-17 9:06 ` [PATCH v2 2/2] rv: Convert to use __free Nam Cao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878qft5gxk.fsf@yellow.woof \
--to=namcao@linutronix.de \
--cc=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).