* [PATCH] x86/module: remove unnecessary check in module_finalize()
@ 2025-02-19 13:48 Dan Carpenter
2025-02-19 17:41 ` Song Liu
2025-02-21 13:37 ` [tip: x86/core] x86/module: Remove " tip-bot2 for Dan Carpenter
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-02-19 13:48 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Mike Rapoport (Microsoft),
Peter Zijlstra, Luis Chamberlain, Will Deacon, Song Liu,
linux-kernel, kernel-janitors
The "calls" pointer can no longer be NULL after commit ab9fea59487d
("x86/alternative: Simplify callthunk patching") was merged. Delete
this unnecessary check.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
arch/x86/kernel/module.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index cb9d295e67cb..615f74c4bd6c 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -278,10 +278,8 @@ int module_finalize(const Elf_Ehdr *hdr,
if (calls) {
struct callthunk_sites cs = {};
- if (calls) {
- cs.call_start = (void *)calls->sh_addr;
- cs.call_end = (void *)calls->sh_addr + calls->sh_size;
- }
+ cs.call_start = (void *)calls->sh_addr;
+ cs.call_end = (void *)calls->sh_addr + calls->sh_size;
callthunks_patch_module_calls(&cs, me);
}
--
2.47.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/module: remove unnecessary check in module_finalize()
2025-02-19 13:48 [PATCH] x86/module: remove unnecessary check in module_finalize() Dan Carpenter
@ 2025-02-19 17:41 ` Song Liu
2025-02-21 13:37 ` [tip: x86/core] x86/module: Remove " tip-bot2 for Dan Carpenter
1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2025-02-19 17:41 UTC (permalink / raw)
To: Dan Carpenter
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Mike Rapoport (Microsoft),
Peter Zijlstra, Luis Chamberlain, Will Deacon, linux-kernel,
kernel-janitors
On Wed, Feb 19, 2025 at 5:48 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The "calls" pointer can no longer be NULL after commit ab9fea59487d
> ("x86/alternative: Simplify callthunk patching") was merged. Delete
> this unnecessary check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Song Liu <song@kernel.org>
> ---
> arch/x86/kernel/module.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
> index cb9d295e67cb..615f74c4bd6c 100644
> --- a/arch/x86/kernel/module.c
> +++ b/arch/x86/kernel/module.c
> @@ -278,10 +278,8 @@ int module_finalize(const Elf_Ehdr *hdr,
> if (calls) {
> struct callthunk_sites cs = {};
>
> - if (calls) {
> - cs.call_start = (void *)calls->sh_addr;
> - cs.call_end = (void *)calls->sh_addr + calls->sh_size;
> - }
> + cs.call_start = (void *)calls->sh_addr;
> + cs.call_end = (void *)calls->sh_addr + calls->sh_size;
>
> callthunks_patch_module_calls(&cs, me);
> }
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: x86/core] x86/module: Remove unnecessary check in module_finalize()
2025-02-19 13:48 [PATCH] x86/module: remove unnecessary check in module_finalize() Dan Carpenter
2025-02-19 17:41 ` Song Liu
@ 2025-02-21 13:37 ` tip-bot2 for Dan Carpenter
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Dan Carpenter @ 2025-02-21 13:37 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Dan Carpenter, Ingo Molnar, Song Liu, x86, linux-kernel
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 06dd759b68eea200e488cafbcfd382208a940777
Gitweb: https://git.kernel.org/tip/06dd759b68eea200e488cafbcfd382208a940777
Author: Dan Carpenter <dan.carpenter@linaro.org>
AuthorDate: Wed, 19 Feb 2025 16:48:49 +03:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 21 Feb 2025 14:27:42 +01:00
x86/module: Remove unnecessary check in module_finalize()
The "calls" pointer can no longer be NULL after the following
commit:
ab9fea59487d ("x86/alternative: Simplify callthunk patching")
Delete this unnecessary check.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/fcbb2f57-0714-4139-b441-8817365c16a1@stanley.mountain
---
arch/x86/kernel/module.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index cb9d295..615f74c 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -278,10 +278,8 @@ int module_finalize(const Elf_Ehdr *hdr,
if (calls) {
struct callthunk_sites cs = {};
- if (calls) {
- cs.call_start = (void *)calls->sh_addr;
- cs.call_end = (void *)calls->sh_addr + calls->sh_size;
- }
+ cs.call_start = (void *)calls->sh_addr;
+ cs.call_end = (void *)calls->sh_addr + calls->sh_size;
callthunks_patch_module_calls(&cs, me);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-21 13:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19 13:48 [PATCH] x86/module: remove unnecessary check in module_finalize() Dan Carpenter
2025-02-19 17:41 ` Song Liu
2025-02-21 13:37 ` [tip: x86/core] x86/module: Remove " tip-bot2 for Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®