Skip to contentSkip to conversation

cxl: Fix warning from emitting resource_size_t as long long int on 32bit systems

PATCH Applied Dave Jiang 2 participants 3 messages Feb 28, 2025 CXL

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 cxl: Fix warning from emitting resource_size_t as long long int on 32bit systems

Reported by kernel test bot from an ARM build:
drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]

On a 32bit system, resource_size_t is defined as 32bit long vs on a 64bit system it is defined as 64bit long. Use %pa format to deal with resource_size_t.

Fixes 0ec9849b6333 ("acpi/hmat / cxl: Add extended linear cache support for CXL")

---
v2:
- Fix commit log spelling errors. (Alison)
- Use %pa to deal with type resource_size_t. (Alison)

---
 drivers/cxl/core/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/region.c +2 -2
index a83301f24fa2..8537b6a9ca18 100644
@@ -3251,8 +3251,8 @@ static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
 
 	if (size != cache_size) {
 		dev_warn(&cxlr->dev,
-			 "Extended Linear Cache size %lld != CXL size %lld. No Support!",
-			 cache_size, size);
+			 "Extended Linear Cache size %pa != CXL size %pa. No Support!",
+			 &cache_size, &size);
 		return -EOPNOTSUPP;
 	}
 
Signature · 1 line
2.48.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dave Jiang

Reported by kernel test bot from an ARM build:
drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]

On a 32bit system, resource_size_t is defined as 32bit long vs on a 64bit system it is defined as 64bit long. Use %pa format to deal with resource_size_t.

Fixes 0ec9849b6333 ("acpi/hmat / cxl: Add extended linear cache support for CXL")
Quoted 27 lines

---
v2:
- Fix commit log spelling errors. (Alison)
- Use %pa to deal with type resource_size_t. (Alison)

---
 drivers/cxl/core/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/region.c +2 -2
index a83301f24fa2..8537b6a9ca18 100644
@@ -3251,8 +3251,8 @@ static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
 
 	if (size != cache_size) {
 		dev_warn(&cxlr->dev,
-			 "Extended Linear Cache size %lld != CXL size %lld. No Support!",
-			 cache_size, size);
+			 "Extended Linear Cache size %pa != CXL size %pa. No Support!",
+			 &cache_size, &size);
 		return -EOPNOTSUPP;
 	}
 
Signature · 1 line
2.48.1
author maintainer Applied
#2 lore raw
In reply to Dave Jiang
Quoted 10 lines · Dave Jiang

Reported by kernel test bot from an ARM build:
drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]

On a 32bit system, resource_size_t is defined as 32bit long vs on a 64bit system it is defined as 64bit long. Use %pa format to deal with resource_size_t.

Fixes 0ec9849b6333 ("acpi/hmat / cxl: Add extended linear cache support for CXL")

Applied to cxl/next

Quoted 23 lines

---
v2:
- Fix commit log spelling errors. (Alison)
- Use %pa to deal with type resource_size_t. (Alison)

---
 drivers/cxl/core/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/region.c +2 -2
index a83301f24fa2..8537b6a9ca18 100644
@@ -3251,8 +3251,8 @@ static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
 
 	if (size != cache_size) {
 		dev_warn(&cxlr->dev,
-			 "Extended Linear Cache size %lld != CXL size %lld. No Support!",
-			 cache_size, size);
+			 "Extended Linear Cache size %pa != CXL size %pa. No Support!",
+			 &cache_size, &size);
 		return -EOPNOTSUPP;
 	}