* [PATCH] cxl/hdm: Clean up a debug printk
@ 2024-02-22 6:14 Dan Carpenter
2024-02-22 18:29 ` Dave Jiang
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Dan Carpenter @ 2024-02-22 6:14 UTC (permalink / raw)
To: Davidlohr Bueso
Cc: Jonathan Cameron, Dave Jiang, Alison Schofield, Vishal Verma,
Ira Weiny, Dan Williams, Robert Richter, linux-cxl, linux-kernel,
kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/cxl/core/hdm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 7d97790b893d..0b1843631b26 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -518,9 +518,9 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
}
if (size > avail) {
- dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
+ dev_dbg(dev, "%llu exceeds available %s capacity: %llu\n", size,
cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem",
- &avail);
+ (u64)avail);
rc = -ENOSPC;
goto out;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] cxl/hdm: Clean up a debug printk
2024-02-22 6:14 [PATCH] cxl/hdm: Clean up a debug printk Dan Carpenter
@ 2024-02-22 18:29 ` Dave Jiang
2024-02-22 18:51 ` fan
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Dave Jiang @ 2024-02-22 18:29 UTC (permalink / raw)
To: Dan Carpenter, Davidlohr Bueso
Cc: Jonathan Cameron, Alison Schofield, Vishal Verma, Ira Weiny,
Dan Williams, Robert Richter, linux-cxl, linux-kernel,
kernel-janitors
On 2/21/24 11:14 PM, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/cxl/core/hdm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index 7d97790b893d..0b1843631b26 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -518,9 +518,9 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
> }
>
> if (size > avail) {
> - dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
> + dev_dbg(dev, "%llu exceeds available %s capacity: %llu\n", size,
> cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem",
> - &avail);
> + (u64)avail);
> rc = -ENOSPC;
> goto out;
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cxl/hdm: Clean up a debug printk
2024-02-22 6:14 [PATCH] cxl/hdm: Clean up a debug printk Dan Carpenter
2024-02-22 18:29 ` Dave Jiang
@ 2024-02-22 18:51 ` fan
2025-05-08 4:53 ` fan
2025-05-09 21:01 ` Ira Weiny
3 siblings, 0 replies; 6+ messages in thread
From: fan @ 2024-02-22 18:51 UTC (permalink / raw)
To: Dan Carpenter
Cc: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
Vishal Verma, Ira Weiny, Dan Williams, Robert Richter, linux-cxl,
linux-kernel, kernel-janitors
On Thu, Feb 22, 2024 at 09:14:02AM +0300, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
Reviewed-by: Fan Ni <fan.ni@samsung.com>
> drivers/cxl/core/hdm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index 7d97790b893d..0b1843631b26 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -518,9 +518,9 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
> }
>
> if (size > avail) {
> - dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
> + dev_dbg(dev, "%llu exceeds available %s capacity: %llu\n", size,
> cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem",
> - &avail);
> + (u64)avail);
> rc = -ENOSPC;
> goto out;
> }
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cxl/hdm: Clean up a debug printk
2024-02-22 6:14 [PATCH] cxl/hdm: Clean up a debug printk Dan Carpenter
2024-02-22 18:29 ` Dave Jiang
2024-02-22 18:51 ` fan
@ 2025-05-08 4:53 ` fan
2025-05-09 21:01 ` Ira Weiny
3 siblings, 0 replies; 6+ messages in thread
From: fan @ 2025-05-08 4:53 UTC (permalink / raw)
To: Dan Carpenter
Cc: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
Vishal Verma, Ira Weiny, Dan Williams, Robert Richter, linux-cxl,
linux-kernel, kernel-janitors
On Thu, Feb 22, 2024 at 09:14:02AM +0300, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
Reviewed-by: Fan Ni <fan.ni@samsung.com>
> drivers/cxl/core/hdm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index 7d97790b893d..0b1843631b26 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -518,9 +518,9 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)
> }
>
> if (size > avail) {
> - dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
> + dev_dbg(dev, "%llu exceeds available %s capacity: %llu\n", size,
> cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem",
> - &avail);
> + (u64)avail);
> rc = -ENOSPC;
> goto out;
> }
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cxl/hdm: Clean up a debug printk
2024-02-22 6:14 [PATCH] cxl/hdm: Clean up a debug printk Dan Carpenter
` (2 preceding siblings ...)
2025-05-08 4:53 ` fan
@ 2025-05-09 21:01 ` Ira Weiny
2025-05-09 21:08 ` Dave Jiang
3 siblings, 1 reply; 6+ messages in thread
From: Ira Weiny @ 2025-05-09 21:01 UTC (permalink / raw)
To: Dan Carpenter, Davidlohr Bueso
Cc: Jonathan Cameron, Dave Jiang, Alison Schofield, Vishal Verma,
Ira Weiny, Dan Williams, Robert Richter, linux-cxl, linux-kernel,
kernel-janitors
Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
[snip]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cxl/hdm: Clean up a debug printk
2025-05-09 21:01 ` Ira Weiny
@ 2025-05-09 21:08 ` Dave Jiang
0 siblings, 0 replies; 6+ messages in thread
From: Dave Jiang @ 2025-05-09 21:08 UTC (permalink / raw)
To: Ira Weiny, Dan Carpenter, Davidlohr Bueso
Cc: Jonathan Cameron, Alison Schofield, Vishal Verma, Dan Williams,
Robert Richter, linux-cxl, linux-kernel, kernel-janitors
On 5/9/25 2:01 PM, Ira Weiny wrote:
> Dan Carpenter wrote:
>> 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.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Applied to cxl/next
>
> [snip]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-09 21:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 6:14 [PATCH] cxl/hdm: Clean up a debug printk Dan Carpenter
2024-02-22 18:29 ` Dave Jiang
2024-02-22 18:51 ` fan
2025-05-08 4:53 ` fan
2025-05-09 21:01 ` Ira Weiny
2025-05-09 21:08 ` Dave Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox