Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2020-04-24 18:34:35
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2020-04-24 18:34:35
On Fri, 24 Apr 2020 23:56:25 +0530 "Naveen N. Rao" [off-list ref] wrote:
quoted
#define PATCH_INSN(addr, instr) \ ({ int rc = patch_instruction((unsigned int *)(addr), instr); \ if (rc) \ pr_err("%s:%d Error patching instruction at 0x%pK (%pS): %d\n", \ __func__, __LINE__, \ (void *)(addr), (void *)(addr), rc); \ rc; \ }) Then you can just do: ret = PATCH_INSN(...); if (ret) return ret; in the code.That's really nice. However, in this case, I guess I can simply use an inline function? The primary reason I used the macro was for including a 'return' statement in it.
I thought the primary reason was the __func__, __LINE__ which wont work as expected as an inline. -- Steve