Skip to content

Commit

Permalink
time/sched_clock: Fix formatting of frequency reporting code
Browse files Browse the repository at this point in the history
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 <macro@orcam.me.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204240148220.9383@angie.orcam.me.uk
  • Loading branch information
Maciej W. Rozycki authored and Thomas Gleixner committed May 2, 2022
1 parent cc1b923 commit f4b62e1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kernel/time/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,11 @@ sched_clock_register(u64 (*read)(void), int bits, unsigned long rate)
if (r >= 4000000) {
r = DIV_ROUND_CLOSEST(r, 1000000);
r_unit = 'M';
} else if (r >= 4000) {
r = DIV_ROUND_CLOSEST(r, 1000);
r_unit = 'k';
} else {
if (r >= 4000) {
r = DIV_ROUND_CLOSEST(r, 1000);
r_unit = 'k';
} else {
r_unit = ' ';
}
r_unit = ' ';
}

/* Calculate the ns resolution of this counter */
Expand Down

0 comments on commit f4b62e1

Please sign in to comment.