Re: [PATCH 1/3] ring_buffer: Change some static functions to void

From: Steven Rostedt
Date: Wed Mar 01 2023 - 11:36:21 EST


On Wed, 1 Mar 2023 09:46:50 +0100
Uros Bizjak <ubizjak@xxxxxxxxx> wrote:

> On Tue, Feb 28, 2023 at 11:55 PM Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> >
> > On Tue, 28 Feb 2023 18:59:27 +0100
> > Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> >
> > > The results of some static functions are not used. Change the
> > > type of these function to void and remove unnecessary returns.
> > >
> > > No functional change intended.
> >
> > NAK, instead of dropping the errors, please handle it on the caller side.
>
> I was under the impression that the intention of these two functions
> is to warn if there is any corruption in data pages detected. Please
> note that the patch has no effect on code size, as the compiler is
> smart enough to drop unused return values by itself. So, the change is
> mostly cosmetic as I was just bothered by unused returns. I'm not
> versed enough in the code to introduce additional error handling, so
> considering its minimal impact, the patch can just be dropped.
>

I'm not against the change.

Masami,

I don't think we need to check the return values, as when these checks
fail, it triggers RB_WARN_ON() which disables the ring buffer involved, and
that should stop further progress of other calls to the affected ring
buffer.

-- Steve