From patchwork Thu Sep 8 13:09:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12970057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C40CFC6FA82 for ; Thu, 8 Sep 2022 13:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232114AbiIHNKt (ORCPT ); Thu, 8 Sep 2022 09:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbiIHNKf (ORCPT ); Thu, 8 Sep 2022 09:10:35 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1842A65248; Thu, 8 Sep 2022 06:10:13 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNfYN450QznV70; Thu, 8 Sep 2022 21:07:36 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 21:10:11 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 21:10:10 +0800 From: Zhen Lei To: Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , , , Masahiro Yamada , Alexei Starovoitov , Jiri Olsa , Kees Cook , Andrew Morton , "Luis Chamberlain" , CC: Zhen Lei Subject: [PATCH 3/7] kallsyms: Adjust the types of some local variables Date: Thu, 8 Sep 2022 21:09:32 +0800 Message-ID: <20220908130936.674-4-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20220908130936.674-1-thunder.leizhen@huawei.com> References: <20220908130936.674-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: 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 --- 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))