coresight: etm4x: Cleanup TRCBBCTLR register accesses
authorJames Clark <james.clark@arm.com>
Fri, 4 Mar 2022 17:19:11 +0000 (17:19 +0000)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 13 Apr 2022 17:05:50 +0000 (11:05 -0600)
This is a no-op change for style and consistency and has no effect on
the binary output by the compiler. In sysreg.h fields are defined as
the register name followed by the field name and then _MASK. This
allows for grepping for fields by name rather than using magic numbers.

Signed-off-by: James Clark <james.clark@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Link: https://lore.kernel.org/r/20220304171913.2292458-15-james.clark@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
drivers/hwtracing/coresight/coresight-etm4x.h

index 25f76a656308ea379da74627de392e3009cf1a65..3ae6f4432646af10103a9d9ef01737f6f7dda93a 100644 (file)
@@ -707,10 +707,10 @@ static ssize_t bb_ctrl_store(struct device *dev,
         * individual range comparators. If include then at least 1
         * range must be selected.
         */
-       if ((val & BIT(8)) && (BMVAL(val, 0, 7) == 0))
+       if ((val & TRCBBCTLR_MODE) && (FIELD_GET(TRCBBCTLR_RANGE_MASK, val) == 0))
                return -EINVAL;
 
-       config->bb_ctrl = val & GENMASK(8, 0);
+       config->bb_ctrl = val & (TRCBBCTLR_MODE | TRCBBCTLR_RANGE_MASK);
        return size;
 }
 static DEVICE_ATTR_RW(bb_ctrl);
index 3b81c104a44b0f25043971b41a5319f56e380c8f..15704982357f199923a5c440fd1b28ff1f41d74e 100644 (file)
 
 #define TRCSSPCICRn_PC_MASK                    GENMASK(7, 0)
 
+#define TRCBBCTLR_MODE                         BIT(8)
+#define TRCBBCTLR_RANGE_MASK                   GENMASK(7, 0)
+
 /*
  * System instructions to access ETM registers.
  * See ETMv4.4 spec ARM IHI0064F section 4.3.6 System instructions