lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <310c2bce-e6cb-4268-858b-8466c92266dd@app.fastmail.com>
Date: Wed, 05 Jun 2024 14:17:38 +0100
From: "Jiaxun Yang" <jiaxun.yang@...goat.com>
To: "Thomas Gleixner" <tglx@...utronix.de>,
 "Huacai Chen" <chenhuacai@...nel.org>,
 "Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
 "Daniel Lezcano" <daniel.lezcano@...aro.org>
Cc: linux-kernel@...r.kernel.org,
 "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH v2] clocksource: Add node counter timer driver for MIPS/Loongson64



在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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ