]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cxl/hdm: Clean up a debug printk
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 22 Feb 2024 06:14:02 +0000 (09:14 +0300)
committerDave Jiang <dave.jiang@intel.com>
Fri, 9 May 2025 21:04:08 +0000 (14:04 -0700)
Smatch complains that %pa is for phys_addr_t types and "size" is a u64.

    drivers/cxl/core/hdm.c:521 cxl_dpa_alloc() error: '%pa' expects
    argument of type 'phys_addr_t*', argument 4 has type 'ullong*

Looking at this, to me it seems more useful to print the sizes as
decimal instead of hex.  Let's do that.

[dj: Adjusted based on latest code changes. ]

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://patch.msgid.link/3d3d969d-651d-4e9d-a892-900876a60ab5@moroto.mountain
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/core.h
drivers/cxl/core/hdm.c

index 17b692eb325713bde91fadfc44045f99e3a3c24c..c73f39d14dd7d2bc26ca0e6fa2eaf39df089ebe1 100644 (file)
@@ -76,7 +76,7 @@ void __iomem *devm_cxl_iomap_block(struct device *dev, resource_size_t addr,
 struct dentry *cxl_debugfs_create_dir(const char *dir);
 int cxl_dpa_set_part(struct cxl_endpoint_decoder *cxled,
                     enum cxl_partition_mode mode);
-int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size);
+int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, u64 size);
 int cxl_dpa_free(struct cxl_endpoint_decoder *cxled);
 resource_size_t cxl_dpa_size(struct cxl_endpoint_decoder *cxled);
 resource_size_t cxl_dpa_resource_start(struct cxl_endpoint_decoder *cxled);
index 00c2de629a34d78a4c69401385c7d6046deef3ad..ab1007495f6b94bfd2067557e17ee1a9422cef24 100644 (file)
@@ -604,7 +604,7 @@ int cxl_dpa_set_part(struct cxl_endpoint_decoder *cxled,
        return 0;
 }
 
-static int __cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
+static int __cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, u64 size)
 {
        struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
        struct cxl_dev_state *cxlds = cxlmd->cxlds;
@@ -667,15 +667,15 @@ static int __cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long lon
                skip = res->start - skip_start;
 
        if (size > avail) {
-               dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
-                       res->name, &avail);
+               dev_dbg(dev, "%llu exceeds available %s capacity: %llu\n", size,
+                       res->name, (u64)avail);
                return -ENOSPC;
        }
 
        return __cxl_dpa_reserve(cxled, start, size, skip);
 }
 
-int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
+int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, u64 size)
 {
        struct cxl_port *port = cxled_to_port(cxled);
        int rc;