[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230424214118.06b7ee07@rorschach.local.home>
Date: Mon, 24 Apr 2023 21:41:18 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Beau Belgrave <beaub@...ux.microsoft.com>
Cc: mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
dcook@...ux.microsoft.com, alanau@...ux.microsoft.com,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] tracing/user_events: Prevent same address and bit
per process
On Tue, 11 Apr 2023 14:17:09 -0700
Beau Belgrave <beaub@...ux.microsoft.com> wrote:
> +static bool user_event_enabler_exists(struct user_event_mm *mm,
> + unsigned long uaddr, unsigned char bit)
> +{
> + struct user_event_enabler *enabler;
> + struct user_event_enabler *next;
> +
> + list_for_each_entry_safe(enabler, next, &mm->enablers, link)
> + if (enabler->addr == uaddr &&
> + (enabler->values & ENABLE_VAL_BIT_MASK) == bit)
> + return true;
> +
Please add brackets around complex calls like the above. The no bracket
rule is not if you can get away without using it, but if there's only a
single line.
list_for_each_entry_safe(enabler, next, &mm->enablers, link) {
if (enabler->addr == uaddr &&
(enabler->values & ENABLE_VAL_BIT_MASK) == bit)
return true;
}
-- Steve
> + return false;
> +}
> +
Powered by blists - more mailing lists