Re: [PATCH 6/6] pgo: Fixup code style issues.

From: Joe Perches
Date: Fri May 28 2021 - 16:37:51 EST


On Fri, 2021-05-28 at 23:12 +0300, Jarmo Tiitto wrote:
> Signed-off-by: Jarmo Tiitto <jarmo.tiitto@xxxxxxxxx>

This should have some commit description like:

Do not initialize statics and use tab indentation.
Some would suggest this should be 2 separate patches.

> diff --git a/kernel/pgo/instrument.c b/kernel/pgo/instrument.c
[]
> + if (start <= p && p < end) {

Generally clearer / more commonly written using

[]
if (p >= start && p < end)

> + /* vmlinux core node */
> + if (&vnds[current_node + 1] >= vnds_end)
> + return NULL; /* Out of nodes */
> +
> + current_node++;
> +
> + /* Make sure the node is entirely within the section
> + */
> + if (&vnds[current_node] >= vnds_end ||
> + &vnds[current_node + 1] > vnds_end)
> + return NULL;
> +
> + return &vnds[current_node];
> +
> + } else {

I suggest getting ride of the else and unindenting the block below too
in yet another separate patch so the function fits in 80 columns.

> + /* maybe an module node
> + * find in what module section p points into and
> + * then allocate from that module
> + */

...