* [PATCH] drivers: perf: use us_to_ktime() where appropriate
@ 2025-08-13 8:32 Xichao Zhao
2025-08-27 9:36 ` Mark Rutland
0 siblings, 1 reply; 3+ messages in thread
From: Xichao Zhao @ 2025-08-13 8:32 UTC (permalink / raw)
To: will, mark.rutland; +Cc: linux-perf-users, linux-kernel, Xichao Zhao
The arm_ccn_pmu_poll_period_us are more suitable for using
the us_to_ktime(). This can make the code more concise and
enhance readability.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/perf/arm-ccn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
index 1a0d0e1a2263..8af3563fdf60 100644
--- a/drivers/perf/arm-ccn.c
+++ b/drivers/perf/arm-ccn.c
@@ -565,7 +565,7 @@ module_param_named(pmu_poll_period_us, arm_ccn_pmu_poll_period_us, uint,
static ktime_t arm_ccn_pmu_timer_period(void)
{
- return ns_to_ktime((u64)arm_ccn_pmu_poll_period_us * 1000);
+ return us_to_ktime((u64)arm_ccn_pmu_poll_period_us);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: perf: use us_to_ktime() where appropriate
2025-08-13 8:32 [PATCH] drivers: perf: use us_to_ktime() where appropriate Xichao Zhao
@ 2025-08-27 9:36 ` Mark Rutland
2025-08-27 14:05 ` Robin Murphy
0 siblings, 1 reply; 3+ messages in thread
From: Mark Rutland @ 2025-08-27 9:36 UTC (permalink / raw)
To: Xichao Zhao
Cc: will, linux-perf-users, linux-kernel, robin.murphy,
linux-arm-kernel
[adding Robin and LAKML]
On Wed, Aug 13, 2025 at 04:32:57PM +0800, Xichao Zhao wrote:
> The arm_ccn_pmu_poll_period_us are more suitable for using
> the us_to_ktime(). This can make the code more concise and
> enhance readability.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Superficially this looks fine to me, so:
Acked-by: Mark Rutland <mark.rutland@arm.com>
Will, I assume that (if no-one complains) you'll pick this up when
queueing PMU patches.
Mark.
> ---
> drivers/perf/arm-ccn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
> index 1a0d0e1a2263..8af3563fdf60 100644
> --- a/drivers/perf/arm-ccn.c
> +++ b/drivers/perf/arm-ccn.c
> @@ -565,7 +565,7 @@ module_param_named(pmu_poll_period_us, arm_ccn_pmu_poll_period_us, uint,
>
> static ktime_t arm_ccn_pmu_timer_period(void)
> {
> - return ns_to_ktime((u64)arm_ccn_pmu_poll_period_us * 1000);
> + return us_to_ktime((u64)arm_ccn_pmu_poll_period_us);
> }
>
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: perf: use us_to_ktime() where appropriate
2025-08-27 9:36 ` Mark Rutland
@ 2025-08-27 14:05 ` Robin Murphy
0 siblings, 0 replies; 3+ messages in thread
From: Robin Murphy @ 2025-08-27 14:05 UTC (permalink / raw)
To: Mark Rutland, Xichao Zhao
Cc: will, linux-perf-users, linux-kernel, linux-arm-kernel
On 27/08/2025 10:36 am, Mark Rutland wrote:
> [adding Robin and LAKML]
>
> On Wed, Aug 13, 2025 at 04:32:57PM +0800, Xichao Zhao wrote:
>> The arm_ccn_pmu_poll_period_us are more suitable for using
>> the us_to_ktime(). This can make the code more concise and
>> enhance readability.
>>
>> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
>
> Superficially this looks fine to me, so:
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> Will, I assume that (if no-one complains) you'll pick this up when
> queueing PMU patches.
Yup, the new helper looks entirely appropriate here. We could perhaps
take this opportunity to drop the unnecessary cast as well though, since
automatic promotion from unsigned int to u64 is perfectly well-defined
and unsurprising.
Thanks,
Robin.
>
> Mark.
>
>> ---
>> drivers/perf/arm-ccn.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
>> index 1a0d0e1a2263..8af3563fdf60 100644
>> --- a/drivers/perf/arm-ccn.c
>> +++ b/drivers/perf/arm-ccn.c
>> @@ -565,7 +565,7 @@ module_param_named(pmu_poll_period_us, arm_ccn_pmu_poll_period_us, uint,
>>
>> static ktime_t arm_ccn_pmu_timer_period(void)
>> {
>> - return ns_to_ktime((u64)arm_ccn_pmu_poll_period_us * 1000);
>> + return us_to_ktime((u64)arm_ccn_pmu_poll_period_us);
>> }
>>
>>
>> --
>> 2.34.1
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-27 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 8:32 [PATCH] drivers: perf: use us_to_ktime() where appropriate Xichao Zhao
2025-08-27 9:36 ` Mark Rutland
2025-08-27 14:05 ` Robin Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).