Skip to content

Commit f4b62e1

Browse files
maciej-w-rozyckiKAGA-KOKO
authored andcommitted
time/sched_clock: Fix formatting of frequency reporting code
Use flat rather than nested indentation for chained else/if clauses as per coding-style.rst: if (x == y) { .. } else if (x > y) { ... } else { .... } This also improves readability. Signed-off-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: John Stultz <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cc1b923 commit f4b62e1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

kernel/time/sched_clock.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,11 @@ sched_clock_register(u64 (*read)(void), int bits, unsigned long rate)
202202
if (r >= 4000000) {
203203
r = DIV_ROUND_CLOSEST(r, 1000000);
204204
r_unit = 'M';
205+
} else if (r >= 4000) {
206+
r = DIV_ROUND_CLOSEST(r, 1000);
207+
r_unit = 'k';
205208
} else {
206-
if (r >= 4000) {
207-
r = DIV_ROUND_CLOSEST(r, 1000);
208-
r_unit = 'k';
209-
} else {
210-
r_unit = ' ';
211-
}
209+
r_unit = ' ';
212210
}
213211

214212
/* Calculate the ns resolution of this counter */

0 commit comments

Comments
 (0)