[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <352b71331769747895c86c78521975c56f27ea93.camel@redhat.com>
Date: Fri, 17 Oct 2025 11:53:32 +0200
From: Gabriele Monaco <gmonaco@...hat.com>
To: Nam Cao <namcao@...utronix.de>, linux-kernel@...r.kernel.org, Steven
Rostedt <rostedt@...dmis.org>, linux-trace-kernel@...r.kernel.org
Cc: Tomas Glozar <tglozar@...hat.com>, Juri Lelli <jlelli@...hat.com>, Clark
Williams <williams@...hat.com>, John Kacur <jkacur@...hat.com>
Subject: Re: [PATCH v2 12/20] verification/rvgen: Add support for Hybrid
Automata
On Fri, 2025-10-17 at 11:37 +0200, Nam Cao wrote:
> Gabriele Monaco <gmonaco@...hat.com> writes:
> > + if any(u in self.env_types.values() for u in ["ns", "us", "ms",
> > "s"]):
> > + buff.append("#define HA_CLK_NS")
>
> That any() twisted my brain. Does the following work?
>
> if not {"ns", "us", "ms", "s"}.isdisjoint(self.env_types.values())
>
Yeah that should do, thanks for the suggestion!
> > + match unit:
> > + case "us":
> > + value *= 1000
> > + case "ms":
> > + value *= 1000000
> > + case "s":
> > + value *= 1000000000
>
> Use 10**9 instead, so that we don't have to count the zeroes.
Right, that's not C.. Will fix.
Thanks,
Gabriele
Powered by blists - more mailing lists