]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf/arm-cmn: Fix resource_size_t printk specifier in arm_cmn_init_dtc()
authorNathan Chancellor <nathan@kernel.org>
Thu, 26 Mar 2026 02:19:26 +0000 (19:19 -0700)
committerWill Deacon <will@kernel.org>
Thu, 26 Mar 2026 15:25:21 +0000 (15:25 +0000)
When building for 32-bit ARM, there is a warning when using the %llx
specifier to print a resource_size_t variable:

  drivers/perf/arm-cmn.c: In function 'arm_cmn_init_dtc':
  drivers/perf/arm-cmn.c:2149:73: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Werror=format=]
   2149 |                                      "Failed to request DTC region 0x%llx\n", base);
        |                                                                      ~~~^     ~~~~
        |                                                                         |     |
        |                                                                         |     resource_size_t {aka unsigned int}
        |                                                                         long long unsigned int
        |                                                                      %x

Use the %pa specifier to handle the possible sizes of phys_addr_t
properly. This requires passing the variable by reference.

Fixes: 5394396ff548 ("perf/arm-cmn: Stop claiming entire iomem region")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Robin murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c

index 9fe00d0f4deb3aa43c45b28390a79b8cd2f748ea..f5305c8fdca43f7f895cc5a234918cd7c79599a7 100644 (file)
@@ -2146,7 +2146,7 @@ static int arm_cmn_init_dtc(struct arm_cmn *cmn, struct arm_cmn_node *dn, int id
        size = cmn->part == PART_CMN600 ? SZ_16K : SZ_64K;
        if (!devm_request_mem_region(cmn->dev, base, size, dev_name(cmn->dev)))
                return dev_err_probe(cmn->dev, -EBUSY,
-                                    "Failed to request DTC region 0x%llx\n", base);
+                                    "Failed to request DTC region 0x%pa\n", &base);
 
        writel_relaxed(CMN_DT_DTC_CTL_DT_EN, dtc->base + CMN_DT_DTC_CTL);
        writel_relaxed(CMN_DT_PMCR_PMU_EN | CMN_DT_PMCR_OVFL_INTR_EN, CMN_DT_PMCR(dtc));