Re: [PATCH v3 2/3] ring_buffer: Change some static functions to bool
From: Steven Rostedt
Date: Fri Mar 03 2023 - 12:08:06 EST
On Fri, 3 Mar 2023 22:04:01 +0530
Mukesh Ojha <quic_mojha@xxxxxxxxxxx> wrote:
> > static __always_inline void
> > @@ -5408,9 +5407,8 @@ bool ring_buffer_empty(struct trace_buffer *buffer)
> > {
> > struct ring_buffer_per_cpu *cpu_buffer;
> > unsigned long flags;
> > - bool dolock;
> > + bool dolock, ret;
> > int cpu;
> > - int ret;
>
> nit: would have been nice if you would not have changed existing stuff
> i.e each variable on a separate line.
I agree. I prefer each variable on a separate line, as it makes fixing
"unused variable" warnings easier.
-- Steve
>
> >
> > /* yes this is racy, but if you don't like the race, lock the buffer */
> > for_each_buffer_cpu(buffer, cpu) {
> > @@ -5438,8 +5436,7 @@ bool ring_buffer_empty_cpu(struct trace_buffer *buffer, int cpu)
> > {
> > struct ring_buffer_per_cpu *cpu_buffer;
> > unsigned long flags;
> > - bool dolock;
> > - int ret;
> > + bool dolock, ret;
>
> same here