Skip to contentSkip to conversation

time: timecounter_cyc2time(): mark 1st argument (struct timecounter) as const

PATCH Applied Marc Kleine-Budde 2 participants 2 messages Mar 3, 2021 – Apr 16, 2021 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 time: timecounter_cyc2time(): mark 1st argument (struct timecounter) as const

As the timecounter is not modified in this function, mark it as const.

---
 include/linux/timecounter.h | 2 +-
 kernel/time/timecounter.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/timecounter.h +1 -1
index 754b74a2167f..c6540ceea143 100644
@@ -124,7 +124,7 @@ extern u64 timecounter_read(struct timecounter *tc);
  * This allows conversion of cycle counter values which were generated
  * in the past.
  */
-extern u64 timecounter_cyc2time(struct timecounter *tc,
+extern u64 timecounter_cyc2time(const struct timecounter *tc,
 				u64 cycle_tstamp);
 
 #endif
kernel/time/timecounter.c +1 -1
index 85b98e727306..e6285288d765 100644
@@ -76,7 +76,7 @@ static u64 cc_cyc2ns_backwards(const struct cyclecounter *cc,
 	return ns;
 }
 
-u64 timecounter_cyc2time(struct timecounter *tc,
+u64 timecounter_cyc2time(const struct timecounter *tc,
 			 u64 cycle_tstamp)
 {
 	u64 delta = (cycle_tstamp - tc->cycle_last) & tc->cc->mask;
Signature · 1 line
2.30.1
#1 lore raw

[tip: timers/core] time/timecounter: Mark 1st argument of timecounter_cyc2time() as const

The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     07ff4aed015c564d03fd518d2fb54e5e6948903c
Gitweb:        https://git.kernel.org/tip/07ff4aed015c564d03fd518d2fb54e5e6948903c
Author:        Marc Kleine-Budde <[email protected]>
AuthorDate:    Wed, 03 Mar 2021 11:35:44 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 16 Apr 2021 21:03:50 +02:00

time/timecounter: Mark 1st argument of timecounter_cyc2time() as const

The timecounter is not modified in this function. Mark it as const.

---
 include/linux/timecounter.h | 2 +-
 kernel/time/timecounter.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/timecounter.h +1 -1
index 754b74a..c6540ce 100644
@@ -124,7 +124,7 @@ extern u64 timecounter_read(struct timecounter *tc);
  * This allows conversion of cycle counter values which were generated
  * in the past.
  */
-extern u64 timecounter_cyc2time(struct timecounter *tc,
+extern u64 timecounter_cyc2time(const struct timecounter *tc,
 				u64 cycle_tstamp);
 
 #endif
kernel/time/timecounter.c +1 -1
index 85b98e7..e628528 100644
@@ -76,7 +76,7 @@ static u64 cc_cyc2ns_backwards(const struct cyclecounter *cc,
 	return ns;
 }
 
-u64 timecounter_cyc2time(struct timecounter *tc,
+u64 timecounter_cyc2time(const struct timecounter *tc,
 			 u64 cycle_tstamp)
 {
 	u64 delta = (cycle_tstamp - tc->cycle_last) & tc->cc->mask;