[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/19] aspeed/timer: Fix behaviour running Linux
From: |
Joel Stanley |
Subject: |
Re: [Qemu-devel] [PATCH 08/19] aspeed/timer: Fix behaviour running Linux |
Date: |
Wed, 27 Sep 2023 02:12:07 +0000 |
On Fri, 22 Sept 2023 at 13:21, Cédric Le Goater <clg@kaod.org> wrote:
> > + t->start = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> > + return calculate_time(t, MAX(MAX(t->match[0], t->match[1]), 0));
>
> This MAX(MAX(x, y), 0) looks strange to me. Would you remember where it comes
> from ? Thanks,
That looks very strange. I think you've sorted it, so I wanted to
bring up the MAX macros themselves. It's unfortunate that they create
a non-unique local variable. Are we allowed to borrow the kernels
macros? They have some infrastructure for creating a unique local
variable name, as well as handling the const and non-const variants
with the one macro.
https://elixir.bootlin.com/linux/v6.5/source/include/linux/minmax.h
Cheers,
Joel