Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <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

authored by

Maciej W. Rozycki and committed by
Thomas Gleixner
f4b62e1e cc1b923a

+4 -6
+4 -6
kernel/time/sched_clock.c
··· 202 202 if (r >= 4000000) { 203 203 r = DIV_ROUND_CLOSEST(r, 1000000); 204 204 r_unit = 'M'; 205 + } else if (r >= 4000) { 206 + r = DIV_ROUND_CLOSEST(r, 1000); 207 + r_unit = 'k'; 205 208 } 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 = ' '; 212 210 } 213 211 214 212 /* Calculate the ns resolution of this counter */