mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jarmo Tiitto <jarmo.tiitto@gmail.com>, samitolvanen@google.com
Cc: wcw@google.com, nathan@kernel.org, ndesaulniers@google.com,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH 6/6] pgo: Fixup code style issues.
Date: Fri, 28 May 2021 13:37:44 -0700	[thread overview]
Message-ID: <0a78bd39b9ef40114bc7527709a533143415f0aa.camel@perches.com> (raw)
In-Reply-To: <20210528201213.459483-1-jarmo.tiitto@gmail.com>

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

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
> +		 */

...



  reply	other threads:[~2021-05-28 20:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 20:12 Jarmo Tiitto
2021-05-28 20:37 ` Joe Perches [this message]
2021-05-31 18:18 ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a78bd39b9ef40114bc7527709a533143415f0aa.camel@perches.com \
    --to=joe@perches.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jarmo.tiitto@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=samitolvanen@google.com \
    --cc=wcw@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®