Skip to content

Commit edecd2d

Browse files
chleroympe
authored andcommitted
powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check()
code-patching has been working for years now, time has come to remove debugging messages. Change useful message to KERN_INFO and remove other ones. Also add KERN_ERR to check() macro and change it into a do/while to make checkpatch happy. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/3ff9823c0a812a8a145d979a9600a6d4591b80ee.1638446239.git.christophe.leroy@csgroup.eu
1 parent 62479e6 commit edecd2d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

arch/powerpc/lib/code-patching.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ static int map_patch_area(void *addr, unsigned long text_poke_addr)
9595

9696
err = map_kernel_page(text_poke_addr, (pfn << PAGE_SHIFT), PAGE_KERNEL);
9797

98-
pr_devel("Mapped addr %lx with pfn %lx:%d\n", text_poke_addr, pfn, err);
9998
if (err)
10099
return -1;
101100

@@ -130,8 +129,6 @@ static inline int unmap_patch_area(unsigned long addr)
130129
if (unlikely(!ptep))
131130
return -EINVAL;
132131

133-
pr_devel("clearing mm %p, pte %p, addr %lx\n", &init_mm, ptep, addr);
134-
135132
/*
136133
* In hash, pte_clear flushes the tlb, in radix, we have to
137134
*/
@@ -190,10 +187,9 @@ static int do_patch_instruction(u32 *addr, ppc_inst_t instr)
190187
int patch_instruction(u32 *addr, ppc_inst_t instr)
191188
{
192189
/* Make sure we aren't patching a freed init section */
193-
if (init_mem_is_free && init_section_contains(addr, 4)) {
194-
pr_debug("Skipping init section patching addr: 0x%px\n", addr);
190+
if (init_mem_is_free && init_section_contains(addr, 4))
195191
return 0;
196-
}
192+
197193
return do_patch_instruction(addr, instr);
198194
}
199195
NOKPROBE_SYMBOL(patch_instruction);
@@ -411,8 +407,10 @@ static void __init test_trampoline(void)
411407
asm ("nop;\n");
412408
}
413409

414-
#define check(x) \
415-
if (!(x)) printk("code-patching: test failed at line %d\n", __LINE__);
410+
#define check(x) do { \
411+
if (!(x)) \
412+
pr_err("code-patching: test failed at line %d\n", __LINE__); \
413+
} while (0)
416414

417415
static void __init test_branch_iform(void)
418416
{
@@ -737,7 +735,7 @@ static inline void test_prefixed_patching(void) {}
737735

738736
static int __init test_code_patching(void)
739737
{
740-
printk(KERN_DEBUG "Running code patching self-tests ...\n");
738+
pr_info("Running code patching self-tests ...\n");
741739

742740
test_branch_iform();
743741
test_branch_bform();

0 commit comments

Comments
 (0)