Skip to content

Commit 0a203df

Browse files
anadavIngo Molnar
authored and
Ingo Molnar
committed
x86/alternatives: Remove the return value of text_poke_*()
The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Rick Edgecombe <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent bb0a008 commit 0a203df

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

arch/x86/include/asm/text-patching.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static inline void apply_paravirt(struct paravirt_patch_site *start,
1818
#define __parainstructions_end NULL
1919
#endif
2020

21-
extern void *text_poke_early(void *addr, const void *opcode, size_t len);
21+
extern void text_poke_early(void *addr, const void *opcode, size_t len);
2222

2323
/*
2424
* Clear and restore the kernel write-protection flag on the local CPU.
@@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len);
3737
extern void *text_poke(void *addr, const void *opcode, size_t len);
3838
extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len);
3939
extern int poke_int3_handler(struct pt_regs *regs);
40-
extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
40+
extern void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
4141
extern int after_bootmem;
4242
extern __ro_after_init struct mm_struct *poking_mm;
4343
extern __ro_after_init unsigned long poking_addr;

arch/x86/kernel/alternative.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len)
265265

266266
extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
267267
extern s32 __smp_locks[], __smp_locks_end[];
268-
void *text_poke_early(void *addr, const void *opcode, size_t len);
268+
void text_poke_early(void *addr, const void *opcode, size_t len);
269269

270270
/*
271271
* Are we looking at a near JMP with a 1 or 4-byte displacement.
@@ -667,8 +667,8 @@ void __init alternative_instructions(void)
667667
* instructions. And on the local CPU you need to be protected again NMI or MCE
668668
* handlers seeing an inconsistent instruction while you patch.
669669
*/
670-
void *__init_or_module text_poke_early(void *addr, const void *opcode,
671-
size_t len)
670+
void __init_or_module text_poke_early(void *addr, const void *opcode,
671+
size_t len)
672672
{
673673
unsigned long flags;
674674

@@ -691,7 +691,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode,
691691
* that causes hangs on some VIA CPUs.
692692
*/
693693
}
694-
return addr;
695694
}
696695

697696
__ro_after_init struct mm_struct *poking_mm;
@@ -893,7 +892,7 @@ NOKPROBE_SYMBOL(poke_int3_handler);
893892
* replacing opcode
894893
* - sync cores
895894
*/
896-
void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
895+
void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
897896
{
898897
unsigned char int3 = 0xcc;
899898

@@ -935,7 +934,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
935934
* the writing of the new instruction.
936935
*/
937936
bp_patching_in_progress = false;
938-
939-
return addr;
940937
}
941938

0 commit comments

Comments
 (0)