Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp618549iob; Thu, 12 May 2022 00:29:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvRyQULoXf/VZ6hmA1rkL7zUEPeWXY0NGQ1upJTuXouUmGkfkWd6ad41ZejoL4oSuNnv9Z X-Received: by 2002:a17:90b:1b42:b0:1dc:c56b:58a8 with SMTP id nv2-20020a17090b1b4200b001dcc56b58a8mr9562321pjb.73.1652340580343; Thu, 12 May 2022 00:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652340580; cv=none; d=google.com; s=arc-20160816; b=rEcMBdbZ4yEX7Q4pgYRBTd5QfNDgQOr5Gk243QWlJBnM/JLr2HJpShYIgSFZHcpN+p /6WPVR+2hdkC6S+pRHP23Qf11yY5MONseCecXoBVrSK7j8Op7NkEXdgn6lagsm1mYX7T Ctfz3PskRFq2+IgQCoPcDu+Nkuh9mj9YuBROIeS5egC4tu6l6/XMHseuDA61qGY1rdqR eLoqBTRnx8F0N7KQUFLyDTZ01GyI+L9l7paFF2MsPCMrhDX8TZ1eeEP7o6+t6JsF8Ww/ 26SK6I3G+TYdM6IrYeWIMHfwOLld4FNSUeBbvfxLxDTU7Wpa1ZlpdF6u5dLleR3ubt6N sdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=NdeReNTQu3w1wW6UHfmVSMZkbFrD67zySL7zMBb8xMQ=; b=HlTnYS9T51wUfJaakz14lDpXfkHK39oQhPAepwS6cWnIf82s7hQZYiwA9EI00TuuuS EHx3FrEfUMugvPy+HWkhbt1fUeqjQt2iwi2JwNKcE5lm82pidszuwM2i0AZL49oaGSZH rbq7tXoPl8Daolw7IdywI9hYWYEXwvPjwmG5yXjT4CbCl9WVjDUpTvmqtIfhRACuS4ab KlfDBhUo9xQieeJ7NU8zNw/zM1xN9oRfqRLnlpRO9e0dhAiIG8jOrcdAH+fgF689ijfk ncHytoAmcvPAu4Kzr4iYpJynkyBb7oSZsficrSGYSXkAVFqK1J2PZqAbt/kuew5hpD3H fm6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uWCA76a7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om5-20020a17090b3a8500b001d927ecd930si2598332pjb.178.2022.05.12.00.29.27; Thu, 12 May 2022 00:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uWCA76a7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348903AbiEKW6E (ORCPT + 99 others); Wed, 11 May 2022 18:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348936AbiEKW6B (ORCPT ); Wed, 11 May 2022 18:58:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5EA59976 for ; Wed, 11 May 2022 15:57:59 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652309877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NdeReNTQu3w1wW6UHfmVSMZkbFrD67zySL7zMBb8xMQ=; b=uWCA76a7wTK/ZXfsrxpngC/jOSLLUlw9uenY3ijmhl8Nxuh/g7PAxx1VxtitXvPCRXyDH5 IzvjliNKTI31tC5fXUVse1kVDmWevznK6YI34S2G6vAYt4cLwqjIVYxMSD84sZS1R76wZV eoGFW71ScrYY762ApsNmh1NmDZp/NbDlF3vOSAK3sDXKK8hNo6inhCBZDjWiISis07Mb1Z V6gi8vrLQr0ZlYUwKW8cvfYgTZ49aCuVDIxvGAJlYYxQs+WN+UCMTWswsZRGH2cH/042Pn Vkpe5OAa2YuT2DNVfrKfphBTKpVHOekvKwS3wSsR0KQ5ZwZ1xDI2VVEmeKzsHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652309877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NdeReNTQu3w1wW6UHfmVSMZkbFrD67zySL7zMBb8xMQ=; b=oU/j3S9dg6gmCpOLEWoOKuwst9AD4kLGAnpG+4DY/iSKLosgUu6DXkfpLu5nCP/wN9zQwk nsUfOTJFsIEyzyAg== To: Stephen Boyd , John Stultz Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tejun Heo , Lai Jiangshan , Guenter Roeck Subject: Re: [PATCH] timers: Provide a better debugobjects hint for delayed works In-Reply-To: References: <20220504223148.644228-1-swboyd@chromium.org> <87sfphpwvy.ffs@tglx> Date: Thu, 12 May 2022 00:57:57 +0200 Message-ID: <878rr7y8wa.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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