linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 14/16] scripts/kallsyms: make check_symbol_range() void function
Date: Sun, 24 Nov 2019 01:04:42 +0900	[thread overview]
Message-ID: <20191123160444.11251-15-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <20191123160444.11251-1-yamada.masahiro@socionext.com>

There is no more reason to check the return value of
check_symbol_range().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2: None

 scripts/kallsyms.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index d90a6133d7b8..f4d5f131556d 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -155,8 +155,8 @@ static bool is_ignored_symbol(const char *name, char type)
 	return false;
 }
 
-static int check_symbol_range(const char *sym, unsigned long long addr,
-			      struct addr_range *ranges, int entries)
+static void check_symbol_range(const char *sym, unsigned long long addr,
+			       struct addr_range *ranges, int entries)
 {
 	size_t i;
 	struct addr_range *ar;
@@ -166,14 +166,12 @@ static int check_symbol_range(const char *sym, unsigned long long addr,
 
 		if (strcmp(sym, ar->start_sym) == 0) {
 			ar->start = addr;
-			return 0;
+			return;
 		} else if (strcmp(sym, ar->end_sym) == 0) {
 			ar->end = addr;
-			return 0;
+			return;
 		}
 	}
-
-	return 1;
 }
 
 static int read_symbol(FILE *in, struct sym_entry *s)
@@ -200,9 +198,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	/* Ignore most absolute/undefined (?) symbols. */
 	if (strcmp(sym, "_text") == 0)
 		_text = s->addr;
-	else if (check_symbol_range(sym, s->addr, text_ranges,
-				    ARRAY_SIZE(text_ranges)) == 0)
-		/* nothing to do */;
+
+	check_symbol_range(sym, s->addr, text_ranges, ARRAY_SIZE(text_ranges));
 
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
-- 
2.17.1


  parent reply	other threads:[~2019-11-23 16:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 16:04 [PATCH v2 00/16] scripts/kallsyms: various cleanups and optimizations Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 01/16] scripts/kallsyms: remove unneeded #ifndef ARRAY_SIZE Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 02/16] scripts/kallsyms: fix definitely-lost memory leak Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 03/16] scripts/kallsyms: shrink table before sorting it Masahiro Yamada
2019-12-07 22:19   ` Olof Johansson
2019-11-23 16:04 ` [PATCH v2 04/16] scripts/kallsyms: set relative_base more effectively Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 05/16] scripts/kallsyms: remove redundant is_arm_mapping_symbol() Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 06/16] scripts/kallsyms: remove unneeded length check for prefix matching Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 07/16] scripts/kallsyms: add sym_name() to mitigate cast ugliness Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 08/16] scripts/kallsyms: replace prefix_underscores_count() with strspn() Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 09/16] scripts/kallsyms: make find_token() return (unsigned char *) Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 10/16] scripts/kallsyms: add const qualifiers where possible Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 11/16] scripts/kallsyms: skip ignored symbols very early Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 12/16] scripts/kallsyms: move more patterns to the ignored_prefixes array Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 13/16] scripts/kallsyms: move ignored symbol types to is_ignored_symbol() Masahiro Yamada
2020-07-20  1:46   ` Finn Thain
2020-07-20  5:34     ` Masahiro Yamada
2020-07-21  4:00       ` Finn Thain
2019-11-23 16:04 ` Masahiro Yamada [this message]
2019-11-23 16:04 ` [PATCH v2 15/16] scripts/kallsyms: put check_symbol_range() calls close together Masahiro Yamada
2019-11-23 16:04 ` [PATCH v2 16/16] scripts/kallsyms: remove redundant initializers Masahiro Yamada

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=20191123160444.11251-15-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).