On Wed, 9 Jul 2025 10:06:26 +0900 Masami Hiramatsu (Google) <mhira...@kernel.org> wrote:
> On Tue, 1 Jul 2025 19:59:39 -0400 > Steven Rostedt <rost...@goodmis.org> wrote: > > > > + * __ftrace_event_enable_disable - enable or disable a trace event > > > + * @file: trace event file associated with the event. > > > + * @enable: 0 or 1 respectively to disable/enable the event (any other > > > value is > > > + * invalid). > > > > Saying 0 or 1 should assume that those are the only values. Don't need the > > content in the parenthesis. > > BTW, it should be "0 or !0"? (or we should make it boolean) > This description means if it is "2", that is undefined. Hmm, now here's an interesting point. So this is to define requirements of a function based on what the function is doing. But does the function have to have strict requirements? If it can handle "0" or "!0" does that mean that's how it will be defined? Or can it just state "0" or "1" and yes "2" is UB. That is, it's not part of the requirements but if someone passes in 2, it could act as a 1 as it's UB and implementation defined. Not a requirement. -- Steve