Commit 1d2dbce9 authored by Adrian Hunter's avatar Adrian Hunter Committed by Namhyung Kim

perf intel-pt: Simplify intel_pt_get_vmcs()

Simplify and remove unnecessary constant expressions.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20231005190451.175568-3-adrian.hunter@intel.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent a91c9872
......@@ -131,19 +131,14 @@ static int intel_pt_get_cbr(const unsigned char *buf, size_t len,
static int intel_pt_get_vmcs(const unsigned char *buf, size_t len,
struct intel_pt_pkt *packet)
{
unsigned int count = (52 - 5) >> 3;
if (count < 1 || count > 7)
return INTEL_PT_BAD_PACKET;
if (len < count + 2)
if (len < 7)
return INTEL_PT_NEED_MORE_BYTES;
packet->type = INTEL_PT_VMCS;
packet->count = count;
memcpy_le64(&packet->payload, buf + 2, count);
packet->count = 5;
memcpy_le64(&packet->payload, buf + 2, 5);
return count + 2;
return 7;
}
static int intel_pt_get_ovf(struct intel_pt_pkt *packet)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment