* [PATCH] cxl/region: use %pap format to print resource_size_t
@ 2024-01-02 17:39 Randy Dunlap
2024-01-02 19:05 ` Dan Williams
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2024-01-02 17:39 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Fan Ni, Davidlohr Bueso, Jonathan Cameron,
Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
Dan Williams, linux-cxl
Use "%pap" to print a resource_size_t (phys_addr_t derived type)
to prevent build warnings on 32-bit arches (seen on i386 and
riscv-32).
../drivers/cxl/core/region.c: In function 'alloc_hpa':
../drivers/cxl/core/region.c:556:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
556 | "HPA allocation error (%ld) for size:%#llx in %s %pr\n",
Fixes: 7984d22f1315 ("cxl/region: Add dev_dbg() detail on failure to allocate HPA space")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Fan Ni <fan.ni@samsung.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: linux-cxl@vger.kernel.org
---
drivers/cxl/core/region.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -- a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -553,8 +553,8 @@ static int alloc_hpa(struct cxl_region *
dev_name(&cxlr->dev));
if (IS_ERR(res)) {
dev_dbg(&cxlr->dev,
- "HPA allocation error (%ld) for size:%#llx in %s %pr\n",
- PTR_ERR(res), size, cxlrd->res->name, cxlrd->res);
+ "HPA allocation error (%ld) for size:%pap in %s %pr\n",
+ PTR_ERR(res), &size, cxlrd->res->name, cxlrd->res);
return PTR_ERR(res);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] cxl/region: use %pap format to print resource_size_t
2024-01-02 17:39 [PATCH] cxl/region: use %pap format to print resource_size_t Randy Dunlap
@ 2024-01-02 19:05 ` Dan Williams
0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2024-01-02 19:05 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel
Cc: Randy Dunlap, Fan Ni, Davidlohr Bueso, Jonathan Cameron,
Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
Dan Williams, linux-cxl
Randy Dunlap wrote:
> Use "%pap" to print a resource_size_t (phys_addr_t derived type)
> to prevent build warnings on 32-bit arches (seen on i386 and
> riscv-32).
>
> ../drivers/cxl/core/region.c: In function 'alloc_hpa':
> ../drivers/cxl/core/region.c:556:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
> 556 | "HPA allocation error (%ld) for size:%#llx in %s %pr\n",
>
> Fixes: 7984d22f1315 ("cxl/region: Add dev_dbg() detail on failure to allocate HPA space")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Fan Ni <fan.ni@samsung.com>
> Cc: Davidlohr Bueso <dave@stgolabs.net>
> Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Alison Schofield <alison.schofield@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: linux-cxl@vger.kernel.org
> ---
> drivers/cxl/core/region.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks Randy.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-02 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 17:39 [PATCH] cxl/region: use %pap format to print resource_size_t Randy Dunlap
2024-01-02 19:05 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®