Commit d05bbad0 authored by James Clark's avatar James Clark Committed by Suzuki K Poulose

coresight: no-op refactor to make INSTP0 check more idiomatic

The spec says this:

  P0 tracing support field. The permitted values are:
      0b00  Tracing of load and store instructions as P0 elements is not
            supported.
      0b11  Tracing of load and store instructions as P0 elements is
            supported, so TRCCONFIGR.INSTP0 is supported.

            All other values are reserved.

The value we are looking for is 0b11 so simplify this. The double read
and && was a bit obfuscated.
Suggested-by: default avatarSuzuki Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarJames Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20220203115336.119735-2-james.clark@arm.comSigned-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
parent 27caf7e4
...@@ -1091,7 +1091,7 @@ static void etm4_init_arch_data(void *info) ...@@ -1091,7 +1091,7 @@ static void etm4_init_arch_data(void *info)
etmidr0 = etm4x_relaxed_read32(csa, TRCIDR0); etmidr0 = etm4x_relaxed_read32(csa, TRCIDR0);
/* INSTP0, bits[2:1] P0 tracing support field */ /* INSTP0, bits[2:1] P0 tracing support field */
if (BMVAL(etmidr0, 1, 1) && BMVAL(etmidr0, 2, 2)) if (BMVAL(etmidr0, 1, 2) == 0b11)
drvdata->instrp0 = true; drvdata->instrp0 = true;
else else
drvdata->instrp0 = false; drvdata->instrp0 = false;
......
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