[PATCH 3/7] kallsyms: Adjust the types of some local variables
From: Zhen Lei
Date: Thu Sep 08 2022 - 09:11:06 EST
The type of kallsyms_num_syms is 'unsigned int', adjust the type of
local variables associated with it for indexing, so that their types
are consistent.
Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
---
kernel/kallsyms.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 3e7e2c2ad2f75ef..9dd4774b6c6edf6 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -190,8 +190,7 @@ static bool cleanup_symbol_name(char *s)
unsigned long kallsyms_lookup_name(const char *name)
{
char namebuf[KSYM_NAME_LEN];
- unsigned long i;
- unsigned int off;
+ unsigned int i, off;
/* Skip the search for empty string. */
if (!*name)
@@ -218,8 +217,7 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
void *data)
{
char namebuf[KSYM_NAME_LEN];
- unsigned long i;
- unsigned int off;
+ unsigned int i, off;
int ret;
for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
@@ -237,7 +235,7 @@ static unsigned long get_symbol_pos(unsigned long addr,
unsigned long *offset)
{
unsigned long symbol_start = 0, symbol_end = 0;
- unsigned long i, low, high, mid;
+ unsigned int i, low, high, mid;
/* This kernel should never had been booted. */
if (!IS_ENABLED(CONFIG_KALLSYMS_BASE_RELATIVE))
--
2.25.1