Re: [PATCH -tip v2] x86/kprobes: Remove unneeded casting from immediate value

From: Steven Rostedt
Date: Tue Feb 14 2023 - 23:44:38 EST


On Wed, 15 Feb 2023 09:10:24 +0900
"Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
>
> Remove unneeded casting from immediate value assignments for relative
> jump offset. Since the immediate values in the 'insn' data structure are
> assigned from immediate bytes as a signed value to insn.immediate.value
> by insn_field_set(). Thus, if we need to access that value as a signed
> value (in this kprobe's case), we don't need to cast it.
> This is a kind of clean up (should not change behavior) follows Nadav's
> bugfix.
>
> Link: https://lore.kernel.org/all/20230208071708.4048-1-namit@xxxxxxxxxx/
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> ---
> Changes in v2:
> - Remove meaningless immediate size branches too.
>

Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

-- Steve