* [PATCH] kallsyms: make arch_get_kallsym() static
@ 2022-07-21 15:10 Ben Dooks
2022-07-21 15:22 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks @ 2022-07-21 15:10 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks
The arch_get_kallsym() function is not used anywhere in the kernel
now, so it should at-least be static or just be removed as there
are no users. Making it static fixes the following sparse warning:
kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
kernel/kallsyms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index fbdf8d3279ac..14922fb21f7b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -587,7 +587,7 @@ struct kallsym_iter {
int show_value;
};
-int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
+static int arch_get_kallsym(unsigned int symnum, unsigned long *value,
char *type, char *name)
{
return -EINVAL;
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] kallsyms: make arch_get_kallsym() static
2022-07-21 15:10 [PATCH] kallsyms: make arch_get_kallsym() static Ben Dooks
@ 2022-07-21 15:22 ` Christoph Hellwig
2022-07-22 8:01 ` Ben Dooks
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2022-07-21 15:22 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-kernel
On Thu, Jul 21, 2022 at 04:10:40PM +0100, Ben Dooks wrote:
> The arch_get_kallsym() function is not used anywhere in the kernel
> now, so it should at-least be static or just be removed as there
> are no users. Making it static fixes the following sparse warning:
>
> kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?
It fixes the warning, but isn't exactly useful. Please just remove it,
get_ksymbol_arch and iter->pos_arch_end entirely instead.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kallsyms: make arch_get_kallsym() static
2022-07-21 15:22 ` Christoph Hellwig
@ 2022-07-22 8:01 ` Ben Dooks
0 siblings, 0 replies; 6+ messages in thread
From: Ben Dooks @ 2022-07-22 8:01 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Ben Dooks, linux-kernel
On Thu, Jul 21, 2022 at 08:22:39AM -0700, Christoph Hellwig wrote:
> On Thu, Jul 21, 2022 at 04:10:40PM +0100, Ben Dooks wrote:
> > The arch_get_kallsym() function is not used anywhere in the kernel
> > now, so it should at-least be static or just be removed as there
> > are no users. Making it static fixes the following sparse warning:
> >
> > kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?
>
> It fixes the warning, but isn't exactly useful. Please just remove it,
> get_ksymbol_arch and iter->pos_arch_end entirely instead.
Ok, probably the best. I didn't have time to do any archeaology on it
to find out if it has ever been used.
--
Ben Dooks, ben@fluff.org, http://www.fluff.org/ben/
Large Hadron Colada: A large Pina Colada that makes the universe disappear.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kallsyms: make arch_get_kallsym static
2021-02-25 7:08 [PATCH] kallsyms: make arch_get_kallsym static Jiapeng Chong
2021-02-25 10:20 ` kernel test robot
@ 2021-02-25 16:56 ` Christoph Hellwig
1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-02-25 16:56 UTC (permalink / raw)
To: Jiapeng Chong
Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
kpsingh, linux-kernel, netdev, bpf
On Thu, Feb 25, 2021 at 03:08:37PM +0800, Jiapeng Chong wrote:
> Fix the following sparse warning:
>
> kernel/kallsyms.c:457:12: warning: symbol 'arch_get_kallsym' was not
> declared. Should it be static?
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Please just remove the function entirely.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kallsyms: make arch_get_kallsym static
2021-02-25 7:08 [PATCH] kallsyms: make arch_get_kallsym static Jiapeng Chong
@ 2021-02-25 10:20 ` kernel test robot
2021-02-25 16:56 ` Christoph Hellwig
1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-02-25 10:20 UTC (permalink / raw)
To: Jiapeng Chong, ast
Cc: kbuild-all, clang-built-linux, daniel, andrii, kafai,
songliubraving, yhs, john.fastabend, kpsingh, linux-kernel,
netdev
[-- Attachment #1: Type: text/plain, Size: 2398 bytes --]
Hi Jiapeng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.11 next-20210225]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jiapeng-Chong/kallsyms-make-arch_get_kallsym-static/20210225-151617
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 29c395c77a9a514c5857c45ceae2665e9bd99ac7
config: powerpc64-randconfig-r034-20210225 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a921aaf789912d981cbb2036bdc91ad7289e1523)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/a7d1bbc523397eaea74cc12deaf0de6a73ce105b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiapeng-Chong/kallsyms-make-arch_get_kallsym-static/20210225-151617
git checkout a7d1bbc523397eaea74cc12deaf0de6a73ce105b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> kernel/kallsyms.c:457:12: error: weak declaration cannot have internal linkage
static int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
^
include/linux/compiler_attributes.h:291:56: note: expanded from macro '__weak'
#define __weak __attribute__((__weak__))
^
1 error generated.
vim +457 kernel/kallsyms.c
456
> 457 static int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
458 char *type, char *name)
459 {
460 return -EINVAL;
461 }
462
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36292 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] kallsyms: make arch_get_kallsym static
@ 2021-02-25 7:08 Jiapeng Chong
2021-02-25 10:20 ` kernel test robot
2021-02-25 16:56 ` Christoph Hellwig
0 siblings, 2 replies; 6+ messages in thread
From: Jiapeng Chong @ 2021-02-25 7:08 UTC (permalink / raw)
To: ast
Cc: daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
kpsingh, linux-kernel, netdev, bpf, Jiapeng Chong
Fix the following sparse warning:
kernel/kallsyms.c:457:12: warning: symbol 'arch_get_kallsym' was not
declared. Should it be static?
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
kernel/kallsyms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 8043a90..a26f98e 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -454,7 +454,7 @@ struct kallsym_iter {
int show_value;
};
-int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
+static int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
char *type, char *name)
{
return -EINVAL;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-22 8:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 15:10 [PATCH] kallsyms: make arch_get_kallsym() static Ben Dooks
2022-07-21 15:22 ` Christoph Hellwig
2022-07-22 8:01 ` Ben Dooks
-- strict thread matches above, loose matches on Subject: below --
2021-02-25 7:08 [PATCH] kallsyms: make arch_get_kallsym static Jiapeng Chong
2021-02-25 10:20 ` kernel test robot
2021-02-25 16:56 ` Christoph Hellwig
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).