* [PATCH] module: Remove the unused function within
@ 2023-02-10 6:42 Jiapeng Chong
2023-02-15 16:47 ` Chris Down
0 siblings, 1 reply; 6+ messages in thread
From: Jiapeng Chong @ 2023-02-10 6:42 UTC (permalink / raw)
To: mcgrof
Cc: chris, nathan, ndesaulniers, trix, linux-modules, linux-kernel,
bpf, llvm, Jiapeng Chong, Abaci Robot
The function within is defined in the main.c file, but not called
elsewhere, so remove this unused function.
kernel/module/main.c:3007:19: warning: unused function 'within'.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4035
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
kernel/module/main.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index c598f11e7016..062065568b40 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -3004,11 +3004,6 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
return load_module(&info, uargs, flags);
}
-static inline int within(unsigned long addr, void *start, unsigned long size)
-{
- return ((void *)addr >= start && (void *)addr < start + size);
-}
-
/* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */
char *module_flags(struct module *mod, char *buf, bool show_state)
{
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] module: Remove the unused function within
2023-02-10 6:42 [PATCH] module: Remove the unused function within Jiapeng Chong
@ 2023-02-15 16:47 ` Chris Down
2023-02-15 17:01 ` Nathan Chancellor
0 siblings, 1 reply; 6+ messages in thread
From: Chris Down @ 2023-02-15 16:47 UTC (permalink / raw)
To: Jiapeng Chong
Cc: mcgrof, nathan, ndesaulniers, trix, linux-modules, linux-kernel,
bpf, llvm, Abaci Robot
Jiapeng Chong writes:
>The function within is defined in the main.c file, but not called
>elsewhere, so remove this unused function.
Huh? It's used by __module_text_address(), no?
>kernel/module/main.c:3007:19: warning: unused function 'within'.
>
>Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4035
>Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>---
> kernel/module/main.c | 5 -----
> 1 file changed, 5 deletions(-)
>
>diff --git a/kernel/module/main.c b/kernel/module/main.c
>index c598f11e7016..062065568b40 100644
>--- a/kernel/module/main.c
>+++ b/kernel/module/main.c
>@@ -3004,11 +3004,6 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
> return load_module(&info, uargs, flags);
> }
>
>-static inline int within(unsigned long addr, void *start, unsigned long size)
>-{
>- return ((void *)addr >= start && (void *)addr < start + size);
>-}
>-
> /* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */
> char *module_flags(struct module *mod, char *buf, bool show_state)
> {
>--
>2.20.1.7.g153144c
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] module: Remove the unused function within
2023-02-15 16:47 ` Chris Down
@ 2023-02-15 17:01 ` Nathan Chancellor
2023-02-15 17:23 ` Chris Down
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2023-02-15 17:01 UTC (permalink / raw)
To: Chris Down
Cc: Jiapeng Chong, mcgrof, ndesaulniers, trix, linux-modules,
linux-kernel, bpf, llvm, Abaci Robot
On Wed, Feb 15, 2023 at 04:47:44PM +0000, Chris Down wrote:
> Jiapeng Chong writes:
> > The function within is defined in the main.c file, but not called
> > elsewhere, so remove this unused function.
>
> Huh? It's used by __module_text_address(), no?
Not after commit 2ece476a2346 ("module: replace module_layout with
module_memory") in -next. This patch should have a fixes tag, even if
the warning is currently hidden behind W=1.
> > kernel/module/main.c:3007:19: warning: unused function 'within'.
> >
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4035
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > ---
> > kernel/module/main.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/kernel/module/main.c b/kernel/module/main.c
> > index c598f11e7016..062065568b40 100644
> > --- a/kernel/module/main.c
> > +++ b/kernel/module/main.c
> > @@ -3004,11 +3004,6 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
> > return load_module(&info, uargs, flags);
> > }
> >
> > -static inline int within(unsigned long addr, void *start, unsigned long size)
> > -{
> > - return ((void *)addr >= start && (void *)addr < start + size);
> > -}
> > -
> > /* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */
> > char *module_flags(struct module *mod, char *buf, bool show_state)
> > {
> > --
> > 2.20.1.7.g153144c
> >
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] module: Remove the unused function within
2023-02-15 17:01 ` Nathan Chancellor
@ 2023-02-15 17:23 ` Chris Down
2023-02-15 18:57 ` Song Liu
0 siblings, 1 reply; 6+ messages in thread
From: Chris Down @ 2023-02-15 17:23 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Jiapeng Chong, mcgrof, ndesaulniers, trix, linux-modules,
linux-kernel, bpf, llvm, Abaci Robot, Song Liu
+Cc: Song
Nathan Chancellor writes:
>On Wed, Feb 15, 2023 at 04:47:44PM +0000, Chris Down wrote:
>> Jiapeng Chong writes:
>> > The function within is defined in the main.c file, but not called
>> > elsewhere, so remove this unused function.
>>
>> Huh? It's used by __module_text_address(), no?
>
>Not after commit 2ece476a2346 ("module: replace module_layout with
>module_memory") in -next. This patch should have a fixes tag, even if
>the warning is currently hidden behind W=1.
Huh, I thought I had checked out latest -next, but must have not done so
somehow :-) Mea culpa.
If it's only in -next then no Fixes needed, since there's no stable rev yet.
Jiapeng, in future, please make sure to cc the author of related commits when
reporting stuff like this :-) It helps people to update their patches.
Song, you probably want to update your patch.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] module: Remove the unused function within
2023-02-15 17:23 ` Chris Down
@ 2023-02-15 18:57 ` Song Liu
2023-02-21 21:21 ` Luis Chamberlain
0 siblings, 1 reply; 6+ messages in thread
From: Song Liu @ 2023-02-15 18:57 UTC (permalink / raw)
To: Chris Down, mcgrof
Cc: Nathan Chancellor, Jiapeng Chong, ndesaulniers, trix,
linux-modules, linux-kernel, bpf, llvm, Abaci Robot
Hi Chris,
On Wed, Feb 15, 2023 at 9:23 AM Chris Down <chris@chrisdown.name> wrote:
>
> +Cc: Song
Thanks for the CC!
>
> Nathan Chancellor writes:
> >On Wed, Feb 15, 2023 at 04:47:44PM +0000, Chris Down wrote:
> >> Jiapeng Chong writes:
> >> > The function within is defined in the main.c file, but not called
> >> > elsewhere, so remove this unused function.
> >>
> >> Huh? It's used by __module_text_address(), no?
> >
> >Not after commit 2ece476a2346 ("module: replace module_layout with
> >module_memory") in -next. This patch should have a fixes tag, even if
> >the warning is currently hidden behind W=1.
>
> Huh, I thought I had checked out latest -next, but must have not done so
> somehow :-) Mea culpa.
>
> If it's only in -next then no Fixes needed, since there's no stable rev yet.
>
> Jiapeng, in future, please make sure to cc the author of related commits when
> reporting stuff like this :-) It helps people to update their patches.
>
> Song, you probably want to update your patch.
Luis, would you prefer a new patch with everything folded in? Or would
you apply the patches on your end?
Thanks,
Song
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] module: Remove the unused function within
2023-02-15 18:57 ` Song Liu
@ 2023-02-21 21:21 ` Luis Chamberlain
0 siblings, 0 replies; 6+ messages in thread
From: Luis Chamberlain @ 2023-02-21 21:21 UTC (permalink / raw)
To: Song Liu
Cc: Chris Down, Nathan Chancellor, Jiapeng Chong, ndesaulniers, trix,
linux-modules, linux-kernel, bpf, llvm, Abaci Robot
On Wed, Feb 15, 2023 at 10:57:09AM -0800, Song Liu wrote:
> Hi Chris,
>
> On Wed, Feb 15, 2023 at 9:23 AM Chris Down <chris@chrisdown.name> wrote:
> >
> > +Cc: Song
>
> Thanks for the CC!
>
> >
> > Nathan Chancellor writes:
> > >On Wed, Feb 15, 2023 at 04:47:44PM +0000, Chris Down wrote:
> > >> Jiapeng Chong writes:
> > >> > The function within is defined in the main.c file, but not called
> > >> > elsewhere, so remove this unused function.
> > >>
> > >> Huh? It's used by __module_text_address(), no?
> > >
> > >Not after commit 2ece476a2346 ("module: replace module_layout with
> > >module_memory") in -next. This patch should have a fixes tag, even if
> > >the warning is currently hidden behind W=1.
> >
> > Huh, I thought I had checked out latest -next, but must have not done so
> > somehow :-) Mea culpa.
> >
> > If it's only in -next then no Fixes needed, since there's no stable rev yet.
> >
> > Jiapeng, in future, please make sure to cc the author of related commits when
> > reporting stuff like this :-) It helps people to update their patches.
> >
> > Song, you probably want to update your patch.
>
> Luis, would you prefer a new patch with everything folded in? Or would
> you apply the patches on your end?
I've merged this patch separately onto modules-next and enhanced the
commit log to explain its needed after your patch.
Luis
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-02-21 21:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10 6:42 [PATCH] module: Remove the unused function within Jiapeng Chong
2023-02-15 16:47 ` Chris Down
2023-02-15 17:01 ` Nathan Chancellor
2023-02-15 17:23 ` Chris Down
2023-02-15 18:57 ` Song Liu
2023-02-21 21:21 ` Luis Chamberlain
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).