Re: [PATCH v10 17/19] rv: Add rtapp_sleep monitor

From: Nam Cao
Date: Tue Jul 01 2025 - 11:12:09 EST


On Tue, Jul 01, 2025 at 11:05:51AM -0400, Steven Rostedt wrote:
> On Tue, 1 Jul 2025 11:02:18 -0400
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > On Tue, 1 Jul 2025 07:17:57 +0200
> > Nam Cao <namcao@xxxxxxxxxxxxx> wrote:
> >
> > > > > + switch (state) {
> > > > > + case S0:
> > > > > + if (val3)
> > > > > + __set_bit(S0, next);
> > > > > + if (val11 && val13)
> > > > > + __set_bit(S1, next);
> > > > > + if (val11 && val14)
> > > > > + __set_bit(S4, next);
> > > > > + if (val5)
> > > > > + __set_bit(S5, next);
> > > > > + break;
> > > >
> > > > What's with all the magic numbers?
> > > >
> > > > Can we turn these into enums so they have some meaning for us humans?
> > >
> > > I'm not sure what you mean, we can't use enums as variables.
> >
> > Bah, never mind. My eyes are getting bad and I need to increase my font
> > size, as all the S0, S1, S2 looked to me like 50, 51, 52, and I was
> > wondering what are all these numbers in the fifties??? :-p

Oh..

> Even with my bad eyesight, these state transitions are generated from
> scripts? If so, can they inject comments that state why they generated
> this?
>
> There's nothing in the code that even states that this was generated
> (if they were).

Yeah this entire file is generated from the LTL specification. I will add a
comment.

Nam