mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Thomas Gleixner" <tglx@linutronix.de>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>
Subject: Re: [PATCH v2] clocksource: Add node counter timer driver for MIPS/Loongson64
Date: Wed, 05 Jun 2024 14:17:38 +0100	[thread overview]
Message-ID: <310c2bce-e6cb-4268-858b-8466c92266dd@app.fastmail.com> (raw)
In-Reply-To: <878qztbvb4.ffs@tglx>



在2024年5月28日五月 下午8:17,Thomas Gleixner写道:
> On Tue, May 28 2024 at 15:31, Jiaxun Yang wrote:
>> 在2024年5月27日五月 下午5:32,Jiaxun Yang写道:
>>> 在2024年5月27日五月 下午4:51,Thomas Gleixner写道:
>>>> Jiaxun!
>>>>
>>> Hi Thomas,
>>> [...]
>>>>
>>>> What's this indirection for? Why dont you update 
>>> [...]
>>>>
>>>>> +static struct clocksource nodecnt_clocksource = {
>>>>> +	.name	= "nodecnt",
>>>>> +	.read	= nodecnt_clocksource_read,
>>>>
>>>> the read function pointer here and spare the indirection?
>>> Smart! sched_clock takes slightly different function pointer argument type
>>> but as we don't use the argument anyway, it should be safe to relax this
>>> indirection.
>>
>> Sadly, I'm unable to remove it with force type catsing :-/
>>
>> drivers/clocksource/loongson-nodecnt.c: In function ‘nodecnt_clocksource_init’:
>> drivers/clocksource/loongson-nodecnt.c:89:36: warning: cast between incompatible function types from ‘u64 (*)(void)’ {aka ‘long long unsigned int (*)(void)’} to ‘u64 (*)(struct clocksource *)’ {aka ‘long long unsigned int (*)(struct clocksource *)’} [-Wcast-function-type]
>>    89 |         nodecnt_clocksource.read = (u64 (*)(struct clocksource *))nodecnt_read_fn;
>>
>
> What about making the actual read functions have the required function
> signature? The clocksource argument is not used in those real functions.

Sadly sched_clock requires another signature :-/

I can see timer-clint hit into the same pitfall.

Thanks
>
> Thanks,
>
>         tglx

-- 
- Jiaxun

      reply	other threads:[~2024-06-05 13:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 17:13 Jiaxun Yang
2024-05-27 12:20 ` Philippe Mathieu-Daudé
2024-05-27 15:51 ` Thomas Gleixner
2024-05-27 16:32   ` Jiaxun Yang
2024-05-28 14:31     ` Jiaxun Yang
2024-05-28 19:17       ` Thomas Gleixner
2024-06-05 13:17         ` Jiaxun Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=310c2bce-e6cb-4268-858b-8466c92266dd@app.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhuacai@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®