[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878rr7y8wa.ffs@tglx>
Date: Thu, 12 May 2022 00:57:57 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Stephen Boyd <swboyd@...omium.org>,
John Stultz <john.stultz@...aro.org>
Cc: linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
Tejun Heo <tj@...nel.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH] timers: Provide a better debugobjects hint for delayed
works
On Wed, May 11 2022 at 13:02, Stephen Boyd wrote:
> Quoting Thomas Gleixner (2022-05-10 02:20:01)
>> static void *timer_debug_hint(void *addr)
>> {
>> - return ((struct timer_list *) addr)->function;
>> + struct timer_list *timer = addr;
>> + int i;
>> +
>> + for (i = 0; i < ARRAY_SIZE(timer_hints); i++) {
>> + if (timer_hints[i].function == timer->function)
>> + return addr + timer_hints[i].offset;
>
> This locates the correct address of the function pointer 'work.func' but
> it needs to be dereferenced to return the function's address instead of
> the pointer to the function. We don't really care about the function
> signature so we could cast it to a void function pointer and deref:
>
> void (**fn)(void) = addr + timer_hints[i].offset;
That's why I said: "So maybe something like the uncompiled/untested
below."
I was pretty sure that I missed some nasty detail.
> I'll send this version of the patch.
Appreciated.
Thanks,
tglx
Powered by blists - more mailing lists