[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250728092756.C8zMlJtT@linutronix.de>
Date: Mon, 28 Jul 2025 11:36:10 +0200
From: Nam Cao <namcao@...utronix.de>
To: Gabriele Monaco <gmonaco@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rv: Fix wrong type cast in monitors_show()
On Mon, Jul 28, 2025 at 10:59:01AM +0200, Gabriele Monaco wrote:
> Good catch, thanks! The container_of is the way to go.
> Do you have valid reasons not to move the list_head to the top? It's
> not a big deal but it would save computing and summing the offset. It
> doesn't seem name (the current first element) really needs to stay
> there.
I checked x86_64 and riscv64, the generated assembly of this function
before & after moving the list_head on top is almost the same except for
some instructions' intermediate values. Both architectures have
instructions which load data at (pointer + offset), so this offset
computing does not require any extra instruction.
Best regards,
Nam
Powered by blists - more mailing lists